Grazvydas Ignotas 3f60ebc9d6 wl1251: fix potential crash
In case debugfs does not init for some reason (or is disabled
on older kernels) driver does not allocate stats.fw_stats
structure, but tries to clear it later and trips on a NULL
pointer:

Unable to handle kernel NULL pointer dereference at virtual address
00000000
PC is at __memzero+0x24/0x80
Backtrace:
[<bf0ddb88>] (wl1251_debugfs_reset+0x0/0x30 [wl1251])
[<bf0d6a2c>] (wl1251_op_stop+0x0/0x12c [wl1251])
[<bf0bc228>] (ieee80211_stop_device+0x0/0x74 [mac80211])
[<bf0b0d10>] (ieee80211_stop+0x0/0x4ac [mac80211])
[<c02deeac>] (dev_close+0x0/0xb4)
[<c02deac0>] (dev_change_flags+0x0/0x184)
[<c031f478>] (devinet_ioctl+0x0/0x704)
[<c0320720>] (inet_ioctl+0x0/0x100)

Add a NULL pointer check to fix this.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Kalle Valo <kalle.valo@iki.fi>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-03-16 15:20:25 -04:00
..
2009-11-04 18:44:42 -05:00
2009-10-27 16:48:19 -04:00
2009-08-14 09:13:38 -04:00
2010-03-16 15:20:25 -04:00
2010-02-08 16:50:56 -05:00
2009-11-18 17:09:24 -05:00
2009-07-24 15:05:26 -04:00
2009-11-18 17:09:24 -05:00
2009-12-21 18:56:02 -05:00
2010-02-19 15:52:47 -05:00
2009-10-27 16:48:04 -04:00
2010-02-19 15:52:47 -05:00
2010-02-19 15:52:47 -05:00
2010-02-19 15:52:47 -05:00
2010-02-19 15:52:42 -05:00
2010-01-14 18:16:54 -05:00
2010-02-19 15:52:47 -05:00
2009-10-27 16:48:19 -04:00
2010-02-19 15:52:47 -05:00
2010-02-19 15:52:47 -05:00
2010-02-19 15:52:47 -05:00
2010-02-19 15:52:47 -05:00
2010-02-19 15:52:43 -05:00
2010-02-19 15:52:47 -05:00