]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.10.34/mwifiex-clean-pcie-ring-only-when-device-is-present.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.34 / mwifiex-clean-pcie-ring-only-when-device-is-present.patch
CommitLineData
7accec13
GKH
1From 4f7ba432202c8330cc03ab959c6228d0de5dc4a3 Mon Sep 17 00:00:00 2001
2From: Avinash Patil <patila@marvell.com>
3Date: Tue, 18 Feb 2014 15:41:54 -0800
4Subject: mwifiex: clean pcie ring only when device is present
5
6From: Avinash Patil <patila@marvell.com>
7
8commit 4f7ba432202c8330cc03ab959c6228d0de5dc4a3 upstream.
9
10Write io memory to clean PCIe buffer only when PCIe device is
11present else this results into crash because of invalid memory
12access.
13
14Signed-off-by: Avinash Patil <patila@marvell.com>
15Signed-off-by: Bing Zhao <bzhao@marvell.com>
16Signed-off-by: John W. Linville <linville@tuxdriver.com>
17Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18
19---
20 drivers/net/wireless/mwifiex/wmm.c | 3 ++-
21 1 file changed, 2 insertions(+), 1 deletion(-)
22
23--- a/drivers/net/wireless/mwifiex/wmm.c
24+++ b/drivers/net/wireless/mwifiex/wmm.c
25@@ -556,7 +556,8 @@ mwifiex_clean_txrx(struct mwifiex_privat
26 mwifiex_wmm_delete_all_ralist(priv);
27 memcpy(tos_to_tid, ac_to_tid, sizeof(tos_to_tid));
28
29- if (priv->adapter->if_ops.clean_pcie_ring)
30+ if (priv->adapter->if_ops.clean_pcie_ring &&
31+ !priv->adapter->surprise_removed)
32 priv->adapter->if_ops.clean_pcie_ring(priv->adapter);
33 spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
34 }