[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1300091954-10367-1-git-send-email-huzaifas@redhat.com>
Date: Mon, 14 Mar 2011 14:09:14 +0530
From: huzaifas@...hat.com
To: netdev@...r.kernel.org
Cc: khilman@...prootsystems.com, cyril@...com,
Huzaifa Sidhpurwala <huzaifas@...hat.com>
Subject: [PATCH] Fix possible null pointer dereference in davinci_cpdma.c
From: Huzaifa Sidhpurwala <huzaifas@...hat.com>
Check if chan exists before dereferencing it
Signed-off-by: Huzaifa Sidhpurwala <huzaifas@...hat.com>
---
drivers/net/davinci_cpdma.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/davinci_cpdma.c b/drivers/net/davinci_cpdma.c
index e92b2b6..09620a6 100644
--- a/drivers/net/davinci_cpdma.c
+++ b/drivers/net/davinci_cpdma.c
@@ -526,12 +526,13 @@ err_chan_alloc:
int cpdma_chan_destroy(struct cpdma_chan *chan)
{
- struct cpdma_ctlr *ctlr = chan->ctlr;
+ struct cpdma_ctlr *ctlr;
unsigned long flags;
if (!chan)
return -EINVAL;
+ ctrl = chan->ctrl;
spin_lock_irqsave(&ctlr->lock, flags);
if (chan->state != CPDMA_STATE_IDLE)
cpdma_chan_stop(chan);
--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists