diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2013-10-23 06:25:00 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-10-23 06:25:00 -0400 |
commit | 070b6d3122b5e6da7113588aeacbaf54b5ab03a6 (patch) | |
tree | 9f8da6e883a96aeb19d1038ca9690d80032ac502 /sound/usb/6fire/midi.c | |
parent | ea8e6ff212a50e9aa666de36df051b0d9bd8fe3e (diff) | |
parent | e8ddbcf9344bb742465f78779c6854fabf5c8341 (diff) |
Merge tag 'v3.8.13.8' into v3.8-rt
v3.8.13.8
Diffstat (limited to 'sound/usb/6fire/midi.c')
-rw-r--r-- | sound/usb/6fire/midi.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sound/usb/6fire/midi.c b/sound/usb/6fire/midi.c index 26722423330d..f3dd7266c391 100644 --- a/sound/usb/6fire/midi.c +++ b/sound/usb/6fire/midi.c @@ -19,6 +19,10 @@ #include "chip.h" #include "comm.h" +enum { + MIDI_BUFSIZE = 64 +}; + static void usb6fire_midi_out_handler(struct urb *urb) { struct midi_runtime *rt = urb->context; @@ -156,6 +160,12 @@ int usb6fire_midi_init(struct sfire_chip *chip) if (!rt) return -ENOMEM; + rt->out_buffer = kzalloc(MIDI_BUFSIZE, GFP_KERNEL); + if (!rt->out_buffer) { + kfree(rt); + return -ENOMEM; + } + rt->chip = chip; rt->in_received = usb6fire_midi_in_received; rt->out_buffer[0] = 0x80; /* 'send midi' command */ @@ -169,6 +179,7 @@ int usb6fire_midi_init(struct sfire_chip *chip) ret = snd_rawmidi_new(chip->card, "6FireUSB", 0, 1, 1, &rt->instance); if (ret < 0) { + kfree(rt->out_buffer); kfree(rt); snd_printk(KERN_ERR PREFIX "unable to create midi.\n"); return ret; @@ -197,6 +208,9 @@ void usb6fire_midi_abort(struct sfire_chip *chip) void usb6fire_midi_destroy(struct sfire_chip *chip) { - kfree(chip->midi); + struct midi_runtime *rt = chip->midi; + + kfree(rt->out_buffer); + kfree(rt); chip->midi = NULL; } |