mwifiex: fix NULL pointer dereference in set_channel()
authorAmitkumar Karwar <akarwar@marvell.com>
Thu, 2 Feb 2012 04:41:44 +0000 (20:41 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 6 Feb 2012 19:55:50 +0000 (14:55 -0500)
commit477778bb0e7c671860528946b412294684337c5e
tree896e8ba8725599e6ecb9c4b1618a89139017ae38
parent197a4e4e1f7ef11458f09b4dd74397baf6758133
mwifiex: fix NULL pointer dereference in set_channel()

In set_channel() callback handler, "priv" pointer is derived from
net_device. Sometimes net_device pointer coming from the stack
is NULL which causes kernel crash.
This patch fixes the problem by deriving "priv" from wiphy
when net_device pointer is NULL.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/cfg80211.c