public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: nicolas.ferre@atmel•com (Nicolas Ferre)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 1/1] dmaengine: Use Pointer xt after NULL check.
Date: Fri, 26 Jun 2015 14:24:16 +0200	[thread overview]
Message-ID: <558D4470.4090908@atmel.com> (raw)
In-Reply-To: <1435314888-20491-1-git-send-email-maninder1.s@samsung.com>

Le 26/06/2015 12:34, Maninder Singh a ?crit :
> Removing static analysis error:-
> Possible null pointer dereference: xt
> 
> Because currently xt is dereferenced before NULL check,
> Thus Use it after NULL Check.
> 
> Signed-off-by: Maninder Singh <maninder1.s@samsung•com>
> Reviewed-by: Vaneet Narang <v.narang@samsung•com>

Ok:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel•com>

> ---
>  drivers/dma/at_hdmac.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index 59892126..d313acb 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -659,14 +659,14 @@ atc_prep_dma_interleaved(struct dma_chan *chan,
>  	size_t			len = 0;
>  	int			i;
>  
> +	if (unlikely(!xt || xt->numf != 1 || !xt->frame_size))
> +		return NULL;
> +
>  	dev_info(chan2dev(chan),
>  		 "%s: src=0x%08x, dest=0x%08x, numf=%d, frame_size=%d, flags=0x%lx\n",
>  		__func__, xt->src_start, xt->dst_start, xt->numf,
>  		xt->frame_size, flags);
>  
> -	if (unlikely(!xt || xt->numf != 1 || !xt->frame_size))
> -		return NULL;
> -
>  	/*
>  	 * The controller can only "skip" X bytes every Y bytes, so we
>  	 * need to make sure we are given a template that fit that
> 


-- 
Nicolas Ferre

  reply	other threads:[~2015-06-26 12:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26 10:34 [PATCH 1/1] dmaengine: Use Pointer xt after NULL check Maninder Singh
2015-06-26 12:24 ` Nicolas Ferre [this message]
2015-07-07  4:22 ` Vinod Koul

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=558D4470.4090908@atmel.com \
    --to=nicolas.ferre@atmel$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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