projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbbe13e
)
dma: ste_dma40: Fix potential null pointer dereference
author
Sachin Kamat
<sachin.kamat@linaro.org>
Mon, 2 Sep 2013 08:14:59 +0000
(13:44 +0530)
committer
Vinod Koul
<vinod.koul@intel.com>
Mon, 2 Sep 2013 12:06:00 +0000
(17:36 +0530)
kcalloc can return NULL. Check the pointer before dereferencing.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/ste_dma40.c
patch
|
blob
|
history
diff --git
a/drivers/dma/ste_dma40.c
b/drivers/dma/ste_dma40.c
index
df0a606
..
82d2b97
100644
(file)
--- a/
drivers/dma/ste_dma40.c
+++ b/
drivers/dma/ste_dma40.c
@@
-2591,6
+2591,9
@@
dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr,
int i;
sg = kcalloc(periods + 1, sizeof(struct scatterlist), GFP_NOWAIT);
+ if (!sg)
+ return NULL;
+
for (i = 0; i < periods; i++) {
sg_dma_address(&sg[i]) = dma_addr;
sg_dma_len(&sg[i]) = period_len;