netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: huzaifas@redhat.com
To: netdev@vger.kernel.org
Cc: khilman@deeprootsystems.com, cyril@ti.com,
	Huzaifa Sidhpurwala <huzaifas@redhat.com>
Subject: [PATCH] Fix possible null pointer dereference in davinci_cpdma.c
Date: Mon, 14 Mar 2011 14:09:14 +0530	[thread overview]
Message-ID: <1300091954-10367-1-git-send-email-huzaifas@redhat.com> (raw)

From: Huzaifa Sidhpurwala <huzaifas@redhat.com>

Check if chan exists before dereferencing it

Signed-off-by: Huzaifa Sidhpurwala <huzaifas@redhat.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


             reply	other threads:[~2011-03-14  8:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14  8:39 huzaifas [this message]
2011-03-14 22:36 ` [PATCH] Fix possible null pointer dereference in davinci_cpdma.c David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1300091954-10367-1-git-send-email-huzaifas@redhat.com \
    --to=huzaifas@redhat.com \
    --cc=cyril@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).