ieee802154: ca8210: Fix a potential NULL pointer dereference
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 20 Aug 2017 16:25:02 +0000 (18:25 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 20 Aug 2017 18:51:30 +0000 (20:51 +0200)
'spi' is known to be NULL, so we dereference a NULL pointer here.
Use 'pr_crit()' instead of 'dev_crit()' to report the message.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/net/ieee802154/ca8210.c

index 326243fae7e27fa93d73d2f0806b25a8f0a3ba77..24a1eabbbc9da3bf1e34a966a1b14b5f737f5a35 100644 (file)
@@ -917,10 +917,7 @@ static int ca8210_spi_transfer(
        struct cas_control *cas_ctl;
 
        if (!spi) {
-               dev_crit(
-                       &spi->dev,
-                       "NULL spi device passed to ca8210_spi_transfer\n"
-               );
+               pr_crit("NULL spi device passed to %s\n", __func__);
                return -ENODEV;
        }