]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mwiflex: avoid possible null pointer dereference
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 17 May 2016 23:16:01 +0000 (01:16 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 14 Jun 2016 14:21:28 +0000 (17:21 +0300)
Do not dereference card before checking against NULL value.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/pcie.c

index 9246ce890e6d5eb998b13374e1fae535d61861e1..a35db02858b6b4cc127ecae29ea49428fa105563 100644 (file)
@@ -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);