aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/amba-clcd.c
diff options
context:
space:
mode:
authorKiran Padwal <kiran.padwal@smartplayin.com>2015-02-11 04:36:45 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-02-26 03:23:15 -0500
commit11f09e53af05822d8c481edc70c08d925d8ef7dd (patch)
treeb290305261e6f07e7551ba9d153befb25bdb234c /drivers/video/fbdev/amba-clcd.c
parentc517d838eb7d07bbe9507871fab3931deccff539 (diff)
video: ARM CLCD: Add missing error check for devm_kzalloc
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>
Diffstat (limited to 'drivers/video/fbdev/amba-clcd.c')
-rw-r--r--drivers/video/fbdev/amba-clcd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 32c0b6b28097..9362424c2340 100644
--- 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,
599 599
600 len = clcdfb_snprintf_mode(NULL, 0, mode); 600 len = clcdfb_snprintf_mode(NULL, 0, mode);
601 name = devm_kzalloc(dev, len + 1, GFP_KERNEL); 601 name = devm_kzalloc(dev, len + 1, GFP_KERNEL);
602 if (!name)
603 return -ENOMEM;
604
602 clcdfb_snprintf_mode(name, len + 1, mode); 605 clcdfb_snprintf_mode(name, len + 1, mode);
603 mode->name = name; 606 mode->name = name;
604 607