diff mbox

[1/1] mwiflex: avoid possible null pointer dereference

Message ID 1463526961-12019-1-git-send-email-xypron.glpk@gmx.de (mailing list archive)
State Accepted
Commit 141bcf099076df1a74317a5b14dcd56c933b9de8
Delegated to: Kalle Valo
Headers show

Commit Message

Heinrich Schuchardt May 17, 2016, 11:16 p.m. UTC
Do not dereference card before checking against NULL value.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/net/wireless/marvell/mwifiex/pcie.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Kalle Valo June 14, 2016, 2:21 p.m. UTC | #1
Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> Do not dereference card before checking against NULL value.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

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

141bcf099076 mwiflex: avoid possible null pointer dereference
diff mbox

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index 0c7937e..ae1f79e 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -2901,10 +2901,11 @@  static void mwifiex_unregister_dev(struct mwifiex_adapter *adapter)
 {
 	struct pcie_service_card *card = adapter->card;
 	const struct mwifiex_pcie_card_reg *reg;
-	struct pci_dev *pdev = card->dev;
+	struct pci_dev *pdev;
 	int i;
 
 	if (card) {
+		pdev = card->dev;
 		if (card->msix_enable) {
 			for (i = 0; i < MWIFIEX_NUM_MSIX_VECTORS; i++)
 				synchronize_irq(card->msix_entries[i].vector);