diff options
author | Bing Zhao <bzhao@marvell.com> | 2013-09-24 22:31:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-13 19:08:33 -0400 |
commit | c7a448c3372a03c2a0848ed2c5c0ee76518a77b6 (patch) | |
tree | f256e82ea2266cc1446727e11f28b12cca326e50 | |
parent | 28f7ae257183e8064119db486190d2229caae369 (diff) |
mwifiex: fix NULL pointer dereference in usb suspend handler
commit 346ece0b7ba2730b4d633b9e371fe55488803102 upstream.
Bug 60815 - Interface hangs in mwifiex_usb
https://bugzilla.kernel.org/show_bug.cgi?id=60815
[ 2.883807] BUG: unable to handle kernel NULL pointer dereference
at 0000000000000048
[ 2.883813] IP: [<ffffffff815a65e0>] pfifo_fast_enqueue+0x90/0x90
[ 2.883834] CPU: 1 PID: 3220 Comm: kworker/u8:90 Not tainted
3.11.1-monotone-l0 #6
[ 2.883834] Hardware name: Microsoft Corporation Surface with
Windows 8 Pro/Surface with Windows 8 Pro,
BIOS 1.03.0450 03/29/2013
On Surface Pro, suspend to ram gives a NULL pointer dereference in
pfifo_fast_enqueue(). The stack trace reveals that the offending
call is clearing carrier in mwifiex_usb suspend handler.
Since commit 1499d9f "mwifiex: don't drop carrier flag over suspend"
has removed the carrier flag handling over suspend/resume in SDIO
and PCIe drivers, I'm removing it in USB driver too. This also fixes
the bug for Surface Pro.
Tested-by: Dmitry Khromov <icechrome@gmail.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/wireless/mwifiex/usb.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/net/wireless/mwifiex/usb.c b/drivers/net/wireless/mwifiex/usb.c index f90fe21e5bfd..b7adf3d46463 100644 --- a/drivers/net/wireless/mwifiex/usb.c +++ b/drivers/net/wireless/mwifiex/usb.c | |||
@@ -446,9 +446,6 @@ static int mwifiex_usb_suspend(struct usb_interface *intf, pm_message_t message) | |||
446 | */ | 446 | */ |
447 | adapter->is_suspended = true; | 447 | adapter->is_suspended = true; |
448 | 448 | ||
449 | for (i = 0; i < adapter->priv_num; i++) | ||
450 | netif_carrier_off(adapter->priv[i]->netdev); | ||
451 | |||
452 | if (atomic_read(&card->rx_cmd_urb_pending) && card->rx_cmd.urb) | 449 | if (atomic_read(&card->rx_cmd_urb_pending) && card->rx_cmd.urb) |
453 | usb_kill_urb(card->rx_cmd.urb); | 450 | usb_kill_urb(card->rx_cmd.urb); |
454 | 451 | ||
@@ -508,10 +505,6 @@ static int mwifiex_usb_resume(struct usb_interface *intf) | |||
508 | MWIFIEX_RX_CMD_BUF_SIZE); | 505 | MWIFIEX_RX_CMD_BUF_SIZE); |
509 | } | 506 | } |
510 | 507 | ||
511 | for (i = 0; i < adapter->priv_num; i++) | ||
512 | if (adapter->priv[i]->media_connected) | ||
513 | netif_carrier_on(adapter->priv[i]->netdev); | ||
514 | |||
515 | /* Disable Host Sleep */ | 508 | /* Disable Host Sleep */ |
516 | if (adapter->hs_activated) | 509 | if (adapter->hs_activated) |
517 | mwifiex_cancel_hs(mwifiex_get_priv(adapter, | 510 | mwifiex_cancel_hs(mwifiex_get_priv(adapter, |