diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-10-26 21:06:24 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-12-01 14:23:27 -0800 |
commit | 5d7efe5b3768bf53df9b87380ea68baacf11f933 (patch) | |
tree | 57c1411ecd88c014acafe7ade94d4189b2c918e1 /drivers/usb/misc/emi26.c | |
parent | 052ac01aeb84d8427ba8ac3d70991ac01b009b59 (diff) | |
download | linux-3.10-5d7efe5b3768bf53df9b87380ea68baacf11f933.tar.gz linux-3.10-5d7efe5b3768bf53df9b87380ea68baacf11f933.tar.bz2 linux-3.10-5d7efe5b3768bf53df9b87380ea68baacf11f933.zip |
USB: kmemdup() cleanup in drivers/usb/
replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc/emi26.c')
-rw-r--r-- | drivers/usb/misc/emi26.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c index 1fd9cb85f4c..5c0a26cbd12 100644 --- a/drivers/usb/misc/emi26.c +++ b/drivers/usb/misc/emi26.c @@ -53,13 +53,12 @@ static void __exit emi26_exit (void); static int emi26_writememory (struct usb_device *dev, int address, unsigned char *data, int length, __u8 request) { int result; - unsigned char *buffer = kmalloc (length, GFP_KERNEL); + unsigned char *buffer = kmemdup(data, length, GFP_KERNEL); if (!buffer) { err("emi26: kmalloc(%d) failed.", length); return -ENOMEM; } - memcpy (buffer, data, length); /* Note: usb_control_msg returns negative value on error or length of the * data that was written! */ result = usb_control_msg (dev, usb_sndctrlpipe(dev, 0), request, 0x40, address, 0, buffer, length, 300); |