projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b30a3f6
)
dma/shdma: move dereference below the NULL check
author
Dan Carpenter
<
[email protected]
>
Sat, 14 Aug 2010 09:01:45 +0000
(11:01 +0200)
committer
Dan Williams
<
[email protected]
>
Wed, 22 Sep 2010 22:29:17 +0000
(15:29 -0700)
"param" can be NULL here, so only dereference it after the check.
Signed-off-by: Dan Carpenter <
[email protected]
>
Signed-off-by: Dan Williams <
[email protected]
>
drivers/dma/shdma.c
patch
|
blob
|
history
diff --git
a/drivers/dma/shdma.c
b/drivers/dma/shdma.c
index fb64cf36ba61d0e786ecfeb802f43909ade4f2f2..eb6b54dbb8064a9a5d2e71eb3261132195ff6f8d 100644
(file)
--- 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.