Skip to content

Commit

Permalink
dmaengine: Use Pointer xt after NULL check.
Browse files Browse the repository at this point in the history
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>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
maninder42 authored and Vinod Koul committed Jul 7, 2015
1 parent fce9a74 commit 4483320
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/dma/at_hdmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4483320

Please sign in to comment.