Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1402647 > unrolled thread

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

Started byHeinrich Schuchardt <xypron.glpk@gmx.de>
First post2016-05-18 01:20 +0200
Last post2016-05-18 01:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] mwiflex: avoid possible null pointer dereference Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-05-18 01:20 +0200

#1402647 — [PATCH 1/1] mwiflex: avoid possible null pointer dereference

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2016-05-18 01:20 +0200
Subject[PATCH 1/1] mwiflex: avoid possible null pointer dereference
Message-ID<rzWrn-2vB-3@gated-at.bofh.it>
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(-)

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);
-- 
2.1.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web