Search Linux Wireless

[bug report] wifi: cw1200: Convert to GPIO descriptors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Linus Walleij,

Commit 2719a9e7156c ("wifi: cw1200: Convert to GPIO descriptors")
from Jan 31, 2024 (linux-next), leads to the following Smatch static
checker warning:

	drivers/net/wireless/st/cw1200/cw1200_spi.c:446 cw1200_spi_disconnect()
	error: we previously assumed 'self' could be null (see line 439)

drivers/net/wireless/st/cw1200/cw1200_spi.c
    435 static void cw1200_spi_disconnect(struct spi_device *func)
    436 {
    437         struct hwbus_priv *self = spi_get_drvdata(func);
    438 
    439         if (self) {
                    ^^^^
This check can hopefully be removed?

    440                 cw1200_spi_irq_unsubscribe(self);
    441                 if (self->core) {
    442                         cw1200_core_release(self->core);
    443                         self->core = NULL;
    444                 }
    445         }
--> 446         cw1200_spi_off(self, dev_get_platdata(&func->dev));
                               ^^^^
Otherwise we are in trouble.  Unchecked dereference inside the function.

    447 }

regards,
dan carpenter




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux