summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2024-12-17 13:55:48 +0100
committerKalle Valo <kvalo@kernel.org>2024-12-18 18:58:27 +0100
commit146b6057e1fd28fb1a38d300bf76a38dfba7f9fb (patch)
tree06426cab8ffbc2546b4244ce0f239281dba8ca73
parentwifi: iwlwifi: mvm: Fix __counted_by usage in cfg80211_wowlan_nd_* (diff)
downloadlinux-146b6057e1fd28fb1a38d300bf76a38dfba7f9fb.tar.xz
linux-146b6057e1fd28fb1a38d300bf76a38dfba7f9fb.zip
wifi: cw1200: Fix potential NULL dereference
A recent refactoring was identified by smatch to cause another potential NULL dereference: drivers/net/wireless/st/cw1200/cw1200_spi.c:440 cw1200_spi_disconnect() error: we previously assumed 'self' could be null (see line 433) Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202411271742.Xa7CNVh1-lkp@intel.com/ Fixes: 2719a9e7156c ("wifi: cw1200: Convert to GPIO descriptors") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20241217-cw1200-fix-v1-1-911e6b5823ec@linaro.org
-rw-r--r--drivers/net/wireless/st/cw1200/cw1200_spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/st/cw1200/cw1200_spi.c b/drivers/net/wireless/st/cw1200/cw1200_spi.c
index 862964a8cc87..52386dfb5f4a 100644
--- a/drivers/net/wireless/st/cw1200/cw1200_spi.c
+++ b/drivers/net/wireless/st/cw1200/cw1200_spi.c
@@ -442,8 +442,8 @@ static void cw1200_spi_disconnect(struct spi_device *func)
cw1200_core_release(self->core);
self->core = NULL;
}
+ cw1200_spi_off(self, dev_get_platdata(&func->dev));
}
- cw1200_spi_off(self, dev_get_platdata(&func->dev));
}
static int __maybe_unused cw1200_spi_suspend(struct device *dev)