From 52978be636374c4bfb61220b37fa12f55a071c46 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Sat, 30 Sep 2006 23:27:21 -0700 Subject: [PATCH] kmemdup: some users Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/usb/usbmidi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sound/usb/usbmidi.c') diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c index abe29dadd97..0dcf78adb99 100644 --- a/sound/usb/usbmidi.c +++ b/sound/usb/usbmidi.c @@ -323,10 +323,9 @@ static int send_bulk_static_data(struct snd_usb_midi_out_endpoint* ep, const void *data, int len) { int err; - void *buf = kmalloc(len, GFP_KERNEL); + void *buf = kmemdup(data, len, GFP_KERNEL); if (!buf) return -ENOMEM; - memcpy(buf, data, len); dump_urb("sending", buf, len); err = usb_bulk_msg(ep->umidi->chip->dev, ep->urb->pipe, buf, len, NULL, 250); -- cgit v1.2.3