diff options
author | Madhusudhanan Ravindran <mravindran04@gmail.com> | 2015-03-08 10:26:30 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-20 13:54:45 +0100 |
commit | aa5735f139f84a3d1e4ef4d0ba177a25372506fb (patch) | |
tree | d0de370c829fc90170b0cf996d21766e2f463d57 /drivers/staging/fbtft | |
parent | d9954896a286393522a851731c46caba1f7bca19 (diff) | |
download | talos-op-linux-aa5735f139f84a3d1e4ef4d0ba177a25372506fb.tar.gz talos-op-linux-aa5735f139f84a3d1e4ef4d0ba177a25372506fb.zip |
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>
Diffstat (limited to 'drivers/staging/fbtft')
-rw-r--r-- | drivers/staging/fbtft/fbtft-sysfs.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c index 45f8de3d11ad..ba4551fcb9f0 100644 --- a/drivers/staging/fbtft/fbtft-sysfs.c +++ b/drivers/staging/fbtft/fbtft-sysfs.c @@ -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; |