From: Heinrich Schuchardt Date: Tue, 17 May 2016 23:16:01 +0000 (+0200) Subject: mwiflex: avoid possible null pointer dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=141bcf099076df1a74317a5b14dcd56c933b9de8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mwiflex: avoid possible null pointer dereference Do not dereference card before checking against NULL value. Signed-off-by: Heinrich Schuchardt Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c index 9246ce890e6d..a35db02858b6 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);