aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/line6
diff options
context:
space:
mode:
authorLaurent Navet <laurent.navet@gmail.com>2012-12-03 14:20:25 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-07 14:00:35 -0800
commit77ecb6fe6dce7a726b374665fe1b74cc5cac30fd (patch)
treed03381ee7cbc71d8569df6fac60e9ba1b58e462f /drivers/staging/line6
parentstaging: line6: pcm.c fix checkpatch issues (diff)
downloadlinux-dev-77ecb6fe6dce7a726b374665fe1b74cc5cac30fd.tar.xz
linux-dev-77ecb6fe6dce7a726b374665fe1b74cc5cac30fd.zip
staging: line6: Use kmemdup rather than duplicating its implementation
staging: line6: driver.c The semantic patch that makes this output is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Laurent Navet <laurent.navet@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/line6')
-rw-r--r--drivers/staging/line6/driver.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 1e4ce50069a9..71c2a572b5cc 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -307,14 +307,13 @@ int line6_version_request_async(struct usb_line6 *line6)
char *buffer;
int retval;
- buffer = kmalloc(sizeof(line6_request_version), GFP_ATOMIC);
+ buffer = kmemdup(line6_request_version,
+ sizeof(line6_request_version), GFP_ATOMIC);
if (buffer == NULL) {
dev_err(line6->ifcdev, "Out of memory");
return -ENOMEM;
}
- memcpy(buffer, line6_request_version, sizeof(line6_request_version));
-
retval = line6_send_raw_message_async(line6, buffer,
sizeof(line6_request_version));
kfree(buffer);