Return-path: Received: from mout.gmx.net ([212.227.15.15]:59146 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754076AbaJGQJn (ORCPT ); Tue, 7 Oct 2014 12:09:43 -0400 Message-ID: <5434103B.2010701@rempel-privat.de> (sfid-20141007_180947_047019_CC274D33) Date: Tue, 07 Oct 2014 18:09:31 +0200 From: Oleksij Rempel MIME-Version: 1.0 To: Marek Puzyniak , ath9k-devel@lists.ath9k.org CC: linux-wireless@vger.kernel.org Subject: Re: [ath9k-devel] [PATCH] ath9k_htc: avoid kernel panic in ath9k_hw_reset References: <1412694270-14421-1-git-send-email-marek.puzyniak@tieto.com> In-Reply-To: <1412694270-14421-1-git-send-email-marek.puzyniak@tieto.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wQU1XsuQRJ9oOcSRw0FLt97UMeEhNKJig" Sender: linux-wireless-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wQU1XsuQRJ9oOcSRw0FLt97UMeEhNKJig Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am 07.10.2014 um 17:04 schrieb Marek Puzyniak: > hw pointer of ath_hw is not assigned to proper value > in function ath9k_hw_reset what finally causes kernel panic. > This can be solved by proper initialization of ath_hw in > ath9k_init_priv. >=20 > Signed-off-by: Marek Puzyniak Acked-by: Oleksij Rempel > --- >=20 > [432866.234088] BUG: unable to handle kernel NULL pointer dereference a= t 0000000000000030 > [432866.234139] IP: [] ath9k_hw_reset+0xe05/0x13e0 [a= th9k_hw] > [432866.234183] PGD 220dc9067 PUD 220dca067 PMD 0=20 > [432866.234213] Oops: 0000 [#1] SMP=20 > [432866.234234] Modules linked in: ath9k_htc ath9k_common ath9k_hw ath = btrfs xor raid6_pq ufs qnx4 hfsplus hfs minix ntfs msdos jfs xfs libcrc32= c reiserfs ext2 ppdev lp rfcomm bnep binfmt_misc nfsd auth_rpcgss nfs_acl= nfs lockd fscache sunrpc snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_co= dec_generic arc4 joydev uvcvideo videobuf2_vmalloc videobuf2_memops video= buf2_core v4l2_common iwlmvm videodev iwldvm btusb mac80211 bluetooth snd= _hda_intel i915 snd_hda_controller snd_hda_codec snd_hwdep snd_pcm snd_se= q iTCO_wdt snd_seq_device iwlwifi parport_pc tpm_tis dell_laptop snd_time= r cfg80211 drm_kms_helper snd drm psmouse parport soundcore video iTCO_ve= ndor_support dcdbas i2c_algo_bit i2c_i801 lpc_ich dell_wmi pcspkr sparse_= keymap serio_raw wmi evbug mac_hid ahci sdhci_pci libahci sdhci e1000e pt= p pps_core > [432866.234749] CPU: 0 PID: 3131 Comm: NetworkManager Tainted: G = W 3.17.0-rc6-wl+ #63 > [432866.234790] Hardware name: Dell Inc. Latitude E6420/0K0DNP, BIOS A0= 8 10/18/2011 > [432866.234826] task: ffff88021f1221c0 ti: ffff88021e920000 task.ti: ff= ff88021e920000 > [432866.234862] RIP: 0010:[] [] at= h9k_hw_reset+0xe05/0x13e0 [ath9k_hw] > [432866.234913] RSP: 0018:ffff88021e923568 EFLAGS: 00010283 > [432866.234940] RAX: 0000000000000000 RBX: ffff8801c2904330 RCX: 000000= 0000000006 > [432866.234975] RDX: 0000000000000006 RSI: ffff88021f122a18 RDI: ffff88= 021f1221c0 > [432866.235010] RBP: ffff88021e9235d8 R08: 0000000000000000 R09: 000000= 0000000000 > [432866.235044] R10: 0000000000000000 R11: 0000000000000000 R12: 000000= 0000000000 > [432866.235079] R13: 0000000000000000 R14: 0000000000000000 R15: ffff88= 01c2904000 > [432866.235114] FS: 00007f8f64f64800(0000) GS:ffff88022dc00000(0000) k= nlGS:0000000000000000 > [432866.235153] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > [432866.235182] CR2: 0000000000000030 CR3: 0000000220c56000 CR4: 000000= 00000407f0 > [432866.235216] Stack: > [432866.235228] ffff88021e9235d8 ffffffff81800964 0000000000000000 00f= f880120000000 > [432866.235272] 00000000000183f5 ffff8801c2904040 ffff8801c2904040 fff= f88021f7fb818 > [432866.235315] ffff88021e9235d8 ffff8801c2a2a620 ffff8801c2904000 fff= f8801c2a289a0 > [432866.235359] Call Trace: > [432866.235378] [] ath9k_htc_start+0xa3/0x280 [ath9k= _htc] > [432866.235414] [] ? mark_held_locks+0x6a/0x90 > [432866.235458] [] ieee80211_do_open+0x331/0xdd0 [ma= c80211] > [432866.235495] [] ? mutex_unlock+0xe/0x10 > [432866.235532] [] ieee80211_open+0x61/0x70 [mac8021= 1] > [432866.235566] [] __dev_open+0xb6/0x130 > [432866.235594] [] __dev_change_flags+0xac/0x180 > [432866.235625] [] dev_change_flags+0x30/0x70 > [432866.235657] [] ? get_page_from_freelist+0x822/0x= 980 > [432866.235692] [] do_setlink+0x349/0x9e0 > [432866.235721] [] ? trace_hardirqs_on_caller+0x10d/= 0x1d0 > [432866.235755] [] ? trace_hardirqs_on+0xd/0x10 > [432866.235786] [] rtnl_newlink+0x4cb/0x730 > [432866.235816] [] ? rtnl_newlink+0x103/0x730 > [432866.235848] [] rtnetlink_rcv_msg+0xa0/0x240 > [432866.235879] [] ? trace_hardirqs_on+0xd/0x10 > [432866.235910] [] ? rtnl_lock+0x17/0x20 > [432866.235939] [] ? __rtnl_unlock+0x20/0x20 > [432866.235970] [] netlink_rcv_skb+0xb1/0xc0 > [432866.236000] [] rtnetlink_rcv+0x25/0x40 > [432866.236029] [] netlink_unicast+0x18d/0x200 > [432866.236060] [] netlink_sendmsg+0x31d/0x430 > [432866.236091] [] sock_sendmsg+0x9c/0xd0 > [432866.236121] [] ? might_fault+0x8c/0xa0 > [432866.236149] [] ? might_fault+0x43/0xa0 > [432866.236179] [] ? verify_iovec+0x56/0xe0 > [432866.236208] [] ___sys_sendmsg+0x389/0x3a0 > [432866.236239] [] ? __fget+0x5/0xe0 > [432866.236266] [] ? __fdget+0x13/0x20 > [432866.237561] [] ? __fget+0xaa/0xe0 > [432866.238837] [] ? __fget+0x5/0xe0 > [432866.240098] [] ? __fget_light+0x25/0x70 > [432866.241357] [] __sys_sendmsg+0x49/0x90 > [432866.242489] [] SyS_sendmsg+0x12/0x20 > [432866.243308] [] system_call_fastpath+0x1a/0x1f > [432866.244029] Code: 00 41 ff 57 10 bf de 46 03 00 e8 07 91 9c e0 e9 6= d f4 ff ff 66 90 41 81 bf c8 02 00 00 c0 02 00 00 0f 84 df 03 00 00 49 8b= 47 38 <80> 78 30 00 0f 84 7e fb ff ff f6 43 0a 30 49 8b 87 e0 16 00 00=20 > [432866.245634] RIP [] ath9k_hw_reset+0xe05/0x13e0 [= ath9k_hw] > [432866.246399] RSP > [432866.247145] CR2: 0000000000000030 > [432866.252454] ---[ end trace 85181a8c528713c8 ]--- >=20 >=20 > drivers/net/wireless/ath/ath9k/htc_drv_init.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/ne= t/wireless/ath/ath9k/htc_drv_init.c > index d779f4f..4014c4b 100644 > --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c > +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c > @@ -464,6 +464,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *p= riv, > return -ENOMEM; > =20 > ah->dev =3D priv->dev; > + ah->hw =3D priv->hw; > ah->hw_version.devid =3D devid; > ah->hw_version.usbdev =3D drv_info; > ah->ah_flags |=3D AH_USE_EEPROM; >=20 --=20 Regards, Oleksij --wQU1XsuQRJ9oOcSRw0FLt97UMeEhNKJig Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iF4EAREIAAYFAlQ0ED8ACgkQHwImuRkmbWksowD+Mj9M5wtqj62qQ4j/+D0cdhhU ByyEGnSQZSHcBcoHHIIA/iFV+DMr8dKbjZAivOYvo0ttCxgAiBE2+190FW3tRokS =5sDu -----END PGP SIGNATURE----- --wQU1XsuQRJ9oOcSRw0FLt97UMeEhNKJig--