Commit 36e8c27f authored by Samreen's avatar Samreen Committed by Tomi Valkeinen

OMAP: DSS2: OMAPFB: Add null pointer check

A null pointer check added. And using kstrdup()
instead of kmalloc() & strcpy()
Signed-off-by: default avatarSamreen <samreen@ti.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@nokia.com>
parent ed3f9095
......@@ -2132,8 +2132,9 @@ static int omapfb_parse_def_modes(struct omapfb2_device *fbdev)
char *str, *options, *this_opt;
int r = 0;
str = kmalloc(strlen(def_mode) + 1, GFP_KERNEL);
strcpy(str, def_mode);
str = kstrdup(def_mode, GFP_KERNEL);
if (!str)
return -ENOMEM;
options = str;
while (!r && (this_opt = strsep(&options, ",")) != NULL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment