diff options
Diffstat (limited to 'sound/usb/usbmidi.c')
-rw-r--r-- | sound/usb/usbmidi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c index abe29dadd979..0dcf78adb99a 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, | |||
323 | const void *data, int len) | 323 | const void *data, int len) |
324 | { | 324 | { |
325 | int err; | 325 | int err; |
326 | void *buf = kmalloc(len, GFP_KERNEL); | 326 | void *buf = kmemdup(data, len, GFP_KERNEL); |
327 | if (!buf) | 327 | if (!buf) |
328 | return -ENOMEM; | 328 | return -ENOMEM; |
329 | memcpy(buf, data, len); | ||
330 | dump_urb("sending", buf, len); | 329 | dump_urb("sending", buf, len); |
331 | err = usb_bulk_msg(ep->umidi->chip->dev, ep->urb->pipe, buf, len, | 330 | err = usb_bulk_msg(ep->umidi->chip->dev, ep->urb->pipe, buf, len, |
332 | NULL, 250); | 331 | NULL, 250); |