diff mbox

mwifiex: Fix request_irq() failure handling

Message ID 1468586919-7534-1-git-send-email-akarwar@marvell.com (mailing list archive)
State Accepted
Commit 2af86f9d954ee86e9b1c492e025de37a1b6d2db8
Delegated to: Kalle Valo
Headers show

Commit Message

Amitkumar Karwar July 15, 2016, 12:48 p.m. UTC
From: Karthik D A <karthida@marvell.com>

It's been observed that request_irq() failure leads to a system crash
due to a bug in mwifiex driver.
When this failure happens, mwifiex_add_card() already takes care of
clearing and freeing adapter->card pointer. This patch removes the
redundant cleanup code causing crash.

Signed-off-by: Karthik D A <karthida@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/pcie.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Kalle Valo July 18, 2016, 7:42 p.m. UTC | #1
Amitkumar Karwar <akarwar@marvell.com> wrote:
> From: Karthik D A <karthida@marvell.com>
> 
> It's been observed that request_irq() failure leads to a system crash
> due to a bug in mwifiex driver.
> When this failure happens, mwifiex_add_card() already takes care of
> clearing and freeing adapter->card pointer. This patch removes the
> redundant cleanup code causing crash.
> 
> Signed-off-by: Karthik D A <karthida@marvell.com>
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>

Thanks, 1 patch applied to wireless-drivers-next.git:

2af86f9d954e mwifiex: Fix request_irq() failure handling
diff mbox

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index e54a98a..d61d4ad 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -202,7 +202,6 @@  static int mwifiex_pcie_probe(struct pci_dev *pdev,
 	if (mwifiex_add_card(card, &add_remove_card_sem, &pcie_ops,
 			     MWIFIEX_PCIE)) {
 		pr_err("%s failed\n", __func__);
-		kfree(card);
 		return -1;
 	}
 
@@ -2843,7 +2842,6 @@  static int mwifiex_pcie_request_irq(struct mwifiex_adapter *adapter)
 			  "MRVL_PCIE", &card->share_irq_ctx);
 	if (ret) {
 		pr_err("request_irq failed: ret=%d\n", ret);
-		adapter->card = NULL;
 		return -1;
 	}