public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] staging: nvec: potential NULL dereference on error path
@ 2013-11-07  7:54 Dan Carpenter
  2013-11-07 11:10 ` Julian Andres Klode
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2013-11-07  7:54 UTC (permalink / raw)
  To: Julian Andres Klode
  Cc: devel, Greg Kroah-Hartman, kernel-janitors, Rob Herring,
	linux-tegra, Grant Likely, ac100

We assume nvec->rx can be NULL earlier so I have added a check here as
well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 3066ee2..c64e069 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -681,7 +681,8 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 			dev_err(nvec->dev,
 				"RX buffer overflow on %p: "
 				"Trying to write byte %u of %u\n",
-				nvec->rx, nvec->rx->pos, NVEC_MSG_SIZE);
+				nvec->rx, nvec->rx ? nvec->rx->pos : -1,
+				NVEC_MSG_SIZE);
 		break;
 	default:
 		nvec->state = 0;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-07 11:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07  7:54 [patch] staging: nvec: potential NULL dereference on error path Dan Carpenter
2013-11-07 11:10 ` Julian Andres Klode
2013-11-07 11:22   ` Dan Carpenter
2013-11-07 11:25   ` [patch v2] " Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox