diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-10-26 15:06:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-12-01 17:23:27 -0500 |
commit | 5d7efe5b3768bf53df9b87380ea68baacf11f933 (patch) | |
tree | 57c1411ecd88c014acafe7ade94d4189b2c918e1 /drivers/usb/misc/emi62.c | |
parent | 052ac01aeb84d8427ba8ac3d70991ac01b009b59 (diff) |
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/emi62.c')
-rw-r--r-- | drivers/usb/misc/emi62.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c index fe351371f274..23153eac0dfa 100644 --- a/drivers/usb/misc/emi62.c +++ b/drivers/usb/misc/emi62.c | |||
@@ -61,13 +61,12 @@ static void __exit emi62_exit (void); | |||
61 | static int emi62_writememory (struct usb_device *dev, int address, unsigned char *data, int length, __u8 request) | 61 | static int emi62_writememory (struct usb_device *dev, int address, unsigned char *data, int length, __u8 request) |
62 | { | 62 | { |
63 | int result; | 63 | int result; |
64 | unsigned char *buffer = kmalloc (length, GFP_KERNEL); | 64 | unsigned char *buffer = kmemdup(data, length, GFP_KERNEL); |
65 | 65 | ||
66 | if (!buffer) { | 66 | if (!buffer) { |
67 | err("emi62: kmalloc(%d) failed.", length); | 67 | err("emi62: kmalloc(%d) failed.", length); |
68 | return -ENOMEM; | 68 | return -ENOMEM; |
69 | } | 69 | } |
70 | memcpy (buffer, data, length); | ||
71 | /* Note: usb_control_msg returns negative value on error or length of the | 70 | /* Note: usb_control_msg returns negative value on error or length of the |
72 | * data that was written! */ | 71 | * data that was written! */ |
73 | result = usb_control_msg (dev, usb_sndctrlpipe(dev, 0), request, 0x40, address, 0, buffer, length, 300); | 72 | result = usb_control_msg (dev, usb_sndctrlpipe(dev, 0), request, 0x40, address, 0, buffer, length, 300); |