diff options
author | Linus Walleij <[email protected]> | 2024-10-28 23:06:53 +0100 |
---|---|---|
committer | Kalle Valo <[email protected]> | 2024-10-31 16:20:02 +0200 |
commit | 2b94751626a6d49bbe42a19cc1503bd391016bd5 (patch) | |
tree | 3b1ad8384cd8fd041132b0dd935dddd177628e9c | |
parent | 1e52d0061a8375dab8ae2627a001bf94d95ef3d4 (diff) |
wifi: cw1200: Fix potential NULL dereference
A recent refactoring was identified by static analysis to
cause a potential NULL dereference, fix this!
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Fixes: 2719a9e7156c ("wifi: cw1200: Convert to GPIO descriptors")
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://patch.msgid.link/[email protected]
-rw-r--r-- | drivers/net/wireless/st/cw1200/cw1200_spi.c | 2 |
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 4f346fb977a9..862964a8cc87 100644 --- a/drivers/net/wireless/st/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/st/cw1200/cw1200_spi.c @@ -450,7 +450,7 @@ static int __maybe_unused cw1200_spi_suspend(struct device *dev) { struct hwbus_priv *self = spi_get_drvdata(to_spi_device(dev)); - if (!cw1200_can_suspend(self->core)) + if (self && !cw1200_can_suspend(self->core)) return -EAGAIN; /* XXX notify host that we have to keep CW1200 powered on? */ |