Skip to content

Commit 146b605

Browse files
linuswKalle Valo
authored andcommitted
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 <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Fixes: 2719a9e ("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]
1 parent cc0c53f commit 146b605

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/wireless/st/cw1200/cw1200_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ static void cw1200_spi_disconnect(struct spi_device *func)
442442
cw1200_core_release(self->core);
443443
self->core = NULL;
444444
}
445+
cw1200_spi_off(self, dev_get_platdata(&func->dev));
445446
}
446-
cw1200_spi_off(self, dev_get_platdata(&func->dev));
447447
}
448448

449449
static int __maybe_unused cw1200_spi_suspend(struct device *dev)

0 commit comments

Comments
 (0)