mirror of
https://github.com/torvalds/linux.git
synced 2024-11-19 02:21:47 +00:00
omapfb: Fix potential NULL pointer dereference in kmalloc
Memory allocated, using kmalloc, for new_compat may fail. This patch checks for such an error and prevents potential NULL pointer dereference. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Cc: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
This commit is contained in:
parent
17de805aa6
commit
31fa6e2ae6
@ -111,6 +111,8 @@ static void __init omapdss_omapify_node(struct device_node *node)
|
||||
|
||||
new_len = prop->length + strlen(prefix) * num_strs;
|
||||
new_compat = kmalloc(new_len, GFP_KERNEL);
|
||||
if (!new_compat)
|
||||
return;
|
||||
|
||||
omapdss_prefix_strcpy(new_compat, new_len, prop->value, prop->length);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user