mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Vinod Koul <vinod.koul@intel.com>,
	Michal Simek <michal.simek@xilinx.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH 1/3] dmaengine: pl330: Do not dereference pl330_thread pointer before non-NULL check
Date: Mon, 08 Sep 2014 09:56:59 +0200	[thread overview]
Message-ID: <1410163019.4300.1.camel@AMDC1943> (raw)
In-Reply-To: <5409D6D8.2020802@metafoo.de>

On pią, 2014-09-05 at 17:29 +0200, Lars-Peter Clausen wrote:
> On 09/05/2014 05:04 PM, Krzysztof Kozlowski wrote:
> > Do not dereference the 'struct pl330_thread *thrd' before the check for
> > non-NULL value.
> >
> > This fixes following warning:
> > drivers/dma/pl330.c:1376 pl330_submit_req() warn: variable dereferenced before check 'thrd' (see line 1367)
> 
> I think we can just drop that whole line of checks, none of them will ever 
> be true.

Sure, I'll send another version of the patch.

Thanks for review,
Krzysztof


> 
> >
> > Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> > ---
> >   drivers/dma/pl330.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> > index d5149aacd2fe..47d82070848d 100644
> > --- a/drivers/dma/pl330.c
> > +++ b/drivers/dma/pl330.c
> > @@ -1364,7 +1364,7 @@ static inline u32 _prepare_ccr(const struct pl330_reqcfg *rqc)
> >   static int pl330_submit_req(struct pl330_thread *thrd,
> >   	struct dma_pl330_desc *desc)
> >   {
> > -	struct pl330_dmac *pl330 = thrd->dmac;
> > +	struct pl330_dmac *pl330;
> >   	struct _xfer_spec xs;
> >   	unsigned long flags;
> >   	void __iomem *regs;
> > @@ -1376,6 +1376,7 @@ static int pl330_submit_req(struct pl330_thread *thrd,
> >   	if (!desc || !thrd || thrd->free)
> >   		return -EINVAL;
> >
> > +	pl330 = thrd->dmac;
> >   	regs = thrd->dmac->base;
> >
> >   	if (pl330->state == DYING
> >


      reply	other threads:[~2014-09-08  7:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 15:04 Krzysztof Kozlowski
2014-09-05 15:04 ` [PATCH 2/3] dmaengine: pl330: Fix NULL pointer dereference on probe failure Krzysztof Kozlowski
2014-09-05 15:31   ` Lars-Peter Clausen
2014-09-05 15:04 ` [PATCH 3/3] dmaengine: pl330: Fix NULL pointer dereference on driver unbind Krzysztof Kozlowski
2014-09-05 15:30   ` Lars-Peter Clausen
2014-09-05 15:29 ` [PATCH 1/3] dmaengine: pl330: Do not dereference pl330_thread pointer before non-NULL check Lars-Peter Clausen
2014-09-08  7:56   ` Krzysztof Kozlowski [this message]

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=1410163019.4300.1.camel@AMDC1943 \
    --to=k.kozlowski@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=michal.simek@xilinx.com \
    --cc=vinod.koul@intel.com \
    /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

Powered by JetHome