Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kiran Padwal and committed by
Tomi Valkeinen
11f09e53 c517d838

+3
+3
drivers/video/fbdev/amba-clcd.c
··· 599 599 600 600 len = clcdfb_snprintf_mode(NULL, 0, mode); 601 601 name = devm_kzalloc(dev, len + 1, GFP_KERNEL); 602 + if (!name) 603 + return -ENOMEM; 604 + 602 605 clcdfb_snprintf_mode(name, len + 1, mode); 603 606 mode->name = name; 604 607