Skip to content

Commit

Permalink
dma/shdma: move dereference below the NULL check
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Dan Carpenter authored and Dan Williams committed Sep 22, 2010
1 parent b30a3f6 commit 9f9ff20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/dma/shdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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.
Expand Down

0 comments on commit 9f9ff20

Please sign in to comment.