Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1249293 > unrolled thread

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

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2015-10-17 11:50 +0200
Last post2015-10-17 11:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] [media] netup_unidvb: delete null dereference Julia Lawall <Julia.Lawall@lip6.fr> - 2015-10-17 11:50 +0200

#1249293 — [PATCH 2/2] [media] netup_unidvb: delete null dereference

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2015-10-17 11:50 +0200
Subject[PATCH 2/2] [media] netup_unidvb: delete null dereference
Message-ID<qkwhI-1Ly-19@gated-at.bofh.it>
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@lip6.fr>

---
 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 linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web