summaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-08-14 11:01:45 +0200
committerDan Williams <dan.j.williams@intel.com>2010-09-22 15:29:17 -0700
commit9f9ff20d46c6728b092f34b6a642e1e81ab5e254 (patch)
treeecf89d4f01277ce8c747fee02a67c6fb5f217ca3 /drivers/dma
parentb30a3f6257ed2105259b404d419b4964e363928c (diff)
downloadop-kernel-dev-9f9ff20d46c6728b092f34b6a642e1e81ab5e254.zip
op-kernel-dev-9f9ff20d46c6728b092f34b6a642e1e81ab5e254.tar.gz
dma/shdma: move dereference below the NULL check
"param" can be NULL here, so only dereference it after the check. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/shdma.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
index fb64cf3..eb6b54d 100644
--- a/drivers/dma/shdma.c
+++ b/drivers/dma/shdma.c
@@ -580,7 +580,6 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg(
sh_chan = to_sh_chan(chan);
param = chan->private;
- slave_addr = param->config->addr;
/* Someone calling slave DMA on a public channel? */
if (!param || !sg_len) {
@@ -589,6 +588,8 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg(
return NULL;
}
+ slave_addr = param->config->addr;
+
/*
* if (param != NULL), this is a successfully requested slave channel,
* therefore param->config != NULL too.
OpenPOWER on IntegriCloud