Browse files

ALSA: usb-audio: avoid freeing umidi object twice

The 'umidi' object will be free'd on the error path by snd_usbmidi_free()
when tearing down the rawmidi interface. So we shouldn't try to free it
in snd_usbmidi_create() after having registered the rawmidi interface.

Found by KASAN.

Change-Id: I8534867beeac111370017ef246adc17e23e1a3b1
Signed-off-by: Andrey Konovalov <>
Acked-by: Clemens Ladisch <>
Cc: <>
Signed-off-by: Takashi Iwai <>
  • Loading branch information...
xairy authored and andi34 committed Feb 13, 2016
1 parent 4dc9856 commit 4521c04f2bad83a47c4d6b5a97c9fb3cc03f8d41
Showing with 0 additions and 1 deletion.
  1. +0 −1 sound/usb/midi.c
@@ -2213,7 +2213,6 @@ int snd_usbmidi_create(struct snd_card *card,
err = snd_usbmidi_create_endpoints(umidi, endpoints);
if (err < 0) {
return err;

0 comments on commit 4521c04

Please sign in to comment.