Re: [PATCH 1/1] dmaengine: Use Pointer xt after NULL check.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
> Reviewed-by: Vaneet Narang <v.narang@xxxxxxxxxxx>

Ok:
Acked-by: Nicolas Ferre <nicolas.ferre@xxxxxxxxx>

> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux