提交 36e8c27f 编写于 作者: S Samreen 提交者: Tomi Valkeinen

OMAP: DSS2: OMAPFB: Add null pointer check

A null pointer check added. And using kstrdup()
instead of kmalloc() & strcpy()
Signed-off-by: NSamreen <samreen@ti.com>
Signed-off-by: NTomi Valkeinen <tomi.valkeinen@nokia.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册