summaryrefslogtreecommitdiffstats
path: root/drivers/dma/at_hdmac.c
diff options
context:
space:
mode:
authorManinder Singh <maninder1.s@samsung.com>2015-06-26 12:34:48 +0200
committerVinod Koul <vinod.koul@intel.com>2015-07-07 06:22:11 +0200
commit4483320e241c5f6b63caa912343eb73c8b1dfd18 (patch)
tree31595e8637f7cce4e951d2f5c5e6d5fc81f5e8e1 /drivers/dma/at_hdmac.c
parentdmaengine: imx-dma: Check for clk_prepare_enable() error (diff)
downloadlinux-4483320e241c5f6b63caa912343eb73c8b1dfd18.tar.xz
linux-4483320e241c5f6b63caa912343eb73c8b1dfd18.zip
dmaengine: Use Pointer xt after NULL check.
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>
Diffstat (limited to 'drivers/dma/at_hdmac.c')
-rw-r--r--drivers/dma/at_hdmac.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 59892126d175..d313acbb50e0 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