Commit 9f9ff20d authored by Dan Carpenter's avatar Dan Carpenter Committed by Dan Williams

dma/shdma: move dereference below the NULL check

"param" can be NULL here, so only dereference it after the check.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent b30a3f62
...@@ -580,7 +580,6 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg( ...@@ -580,7 +580,6 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg(
sh_chan = to_sh_chan(chan); sh_chan = to_sh_chan(chan);
param = chan->private; param = chan->private;
slave_addr = param->config->addr;
/* Someone calling slave DMA on a public channel? */ /* Someone calling slave DMA on a public channel? */
if (!param || !sg_len) { if (!param || !sg_len) {
...@@ -589,6 +588,8 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg( ...@@ -589,6 +588,8 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg(
return NULL; return NULL;
} }
slave_addr = param->config->addr;
/* /*
* if (param != NULL), this is a successfully requested slave channel, * if (param != NULL), this is a successfully requested slave channel,
* therefore param->config != NULL too. * therefore param->config != NULL too.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment