linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mans Rullgard <mans.rullgard@linaro.org>
To: Javi Merino <javi.merino@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linaro-dev@lists.linaro.org, patches@linaro.org,
	Russell King <linux@arm.linux.org.uk>,
	Jassi Brar <jaswinder.singh@linaro.org>,
	linux-kernel@vger.kernel.org, Boojin Kim <boojin.kim@samsung.com>,
	Kukjin Kim <kgene.kim@samsung.com>
Subject: [PATCH] ARM: pl330: fix null pointer dereference in pl330_chan_ctrl()
Date: Fri, 13 Jan 2012 19:46:22 +0000	[thread overview]
Message-ID: <1326483982-13610-1-git-send-email-mans.rullgard@linaro.org> (raw)
In-Reply-To: <4F103620.8070504@arm.com>

This fixes the thrd->req_running field being accessed before thrd
is checked for null.  The error was introduced in abb959f.

Signed-off-by: Mans Rullgard <mans.rullgard@linaro.org>
---
 drivers/dma/pl330.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 3a6e042..cb3e597 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -1568,12 +1568,13 @@ static int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)
 	struct pl330_thread *thrd = ch_id;
 	struct pl330_dmac *pl330;
 	unsigned long flags;
-	int ret = 0, active = thrd->req_running;
+	int ret = 0, active;
 
 	if (!thrd || thrd->free || thrd->dmac->state == DYING)
 		return -EINVAL;
 
 	pl330 = thrd->dmac;
+	active = thrd->req_running;
 
 	spin_lock_irqsave(&pl330->lock, flags);
 
-- 
1.7.8.3


  reply	other threads:[~2012-01-13 19:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 12:36 [PATCH] ARM: pl330: fix null pointer dereference in pl330_chan_ctrl() Mans Rullgard
2012-01-13 13:02 ` Russell King - ARM Linux
2012-01-13 13:48 ` Javi Merino
2012-01-13 19:46   ` Mans Rullgard [this message]
2012-01-14 21:53 ` Sergei Shtylyov
2012-01-25 12:11   ` [PATCH] DMA: " Mans Rullgard

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=1326483982-13610-1-git-send-email-mans.rullgard@linaro.org \
    --to=mans.rullgard@linaro.org \
    --cc=boojin.kim@samsung.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=javi.merino@arm.com \
    --cc=kgene.kim@samsung.com \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=patches@linaro.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).