projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c517d83
)
video: ARM CLCD: Add missing error check for devm_kzalloc
author
Kiran Padwal
<kiran.padwal@smartplayin.com>
Wed, 11 Feb 2015 09:36:45 +0000
(15:06 +0530)
committer
Tomi Valkeinen
<tomi.valkeinen@ti.com>
Thu, 26 Feb 2015 08:23:15 +0000
(10:23 +0200)
This patch add a missing check on the return value of devm_kzalloc,
which would cause a NULL pointer dereference in a OOM situation.
Signed-off-by: Kiran Padwal <kiran.padwal@smartplayin.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/amba-clcd.c
patch
|
blob
|
history
diff --git
a/drivers/video/fbdev/amba-clcd.c
b/drivers/video/fbdev/amba-clcd.c
index
32c0b6b
..
9362424
100644
(file)
--- a/
drivers/video/fbdev/amba-clcd.c
+++ b/
drivers/video/fbdev/amba-clcd.c
@@
-599,6
+599,9
@@
static int clcdfb_of_get_mode(struct device *dev, struct device_node *endpoint,
len = clcdfb_snprintf_mode(NULL, 0, mode);
name = devm_kzalloc(dev, len + 1, GFP_KERNEL);
+ if (!name)
+ return -ENOMEM;
+
clcdfb_snprintf_mode(name, len + 1, mode);
mode->name = name;