[PATCH 2/2] [media] netup_unidvb: delete null dereference

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

 



The calls to dev_dbg will not work properly when spi is NULL.  Just use
pr_debug instead.

Problem found using scripts/coccinelle/null/deref_null.cocci

Signed-off-by: Julia Lawall <Julia.Lawall@xxxxxxx>

---
 drivers/media/pci/netup_unidvb/netup_unidvb_spi.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_spi.c b/drivers/media/pci/netup_unidvb/netup_unidvb_spi.c
index f55b327..026895f 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_spi.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_spi.c
@@ -81,8 +81,7 @@ irqreturn_t netup_spi_interrupt(struct netup_spi *spi)
 	unsigned long flags;
 
 	if (!spi) {
-		dev_dbg(&spi->master->dev,
-			"%s(): SPI not initialized\n", __func__);
+		pr_debug("%s(): SPI not initialized\n", __func__);
 		return IRQ_NONE;
 	}
 	spin_lock_irqsave(&spi->lock, flags);
@@ -235,8 +234,7 @@ void netup_spi_release(struct netup_unidvb_dev *ndev)
 	struct netup_spi *spi = ndev->spi;
 
 	if (!spi) {
-		dev_dbg(&spi->master->dev,
-			"%s(): SPI not initialized\n", __func__);
+		pr_debug("%s(): SPI not initialized\n", __func__);
 		return;
 	}
 	spin_lock_irqsave(&spi->lock, flags);

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux