提交 aa5735f1 编写于 作者: M Madhusudhanan Ravindran 提交者: Greg Kroah-Hartman

staging: fbtft: Use kmemdup rather than duplicating its implementation

The semantic patch that makes this change is available
in scriptcoccinelle/api/memdup.cocci.
Signed-off-by: NMadhusudhanan Ravindran <mravindran04@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 d9954896
...@@ -37,10 +37,9 @@ int fbtft_gamma_parse_str(struct fbtft_par *par, unsigned long *curves, ...@@ -37,10 +37,9 @@ int fbtft_gamma_parse_str(struct fbtft_par *par, unsigned long *curves,
fbtft_par_dbg(DEBUG_SYSFS, par, "%s\n", str); fbtft_par_dbg(DEBUG_SYSFS, par, "%s\n", str);
tmp = kmalloc(size+1, GFP_KERNEL); tmp = kmemdup(str, size + 1, GFP_KERNEL);
if (!tmp) if (!tmp)
return -ENOMEM; return -ENOMEM;
memcpy(tmp, str, size+1);
/* replace optional separators */ /* replace optional separators */
str_p = tmp; str_p = tmp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册