mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 22:25:03 +00:00
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: Madhusudhanan Ravindran <mravindran04@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d9954896a2
commit
aa5735f139
1 changed files with 1 additions and 2 deletions
|
@ -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);
|
||||
|
||||
tmp = kmalloc(size+1, GFP_KERNEL);
|
||||
tmp = kmemdup(str, size + 1, GFP_KERNEL);
|
||||
if (!tmp)
|
||||
return -ENOMEM;
|
||||
memcpy(tmp, str, size+1);
|
||||
|
||||
/* replace optional separators */
|
||||
str_p = tmp;
|
||||
|
|
Loading…
Reference in a new issue