Skip to content

Commit

Permalink
ALSA: usb-audio: avoid freeing umidi object twice
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Andrey Konovalov <[email protected]>
Acked-by: Clemens Ladisch <[email protected]>
Cc: <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
xairy authored and tiwai committed Feb 13, 2016
1 parent 86c2ee1 commit 07d86ca
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion sound/usb/midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2455,7 +2455,6 @@ int snd_usbmidi_create(struct snd_card *card,
else
err = snd_usbmidi_create_endpoints(umidi, endpoints);
if (err < 0) {
snd_usbmidi_free(umidi);
return err;
}

Expand Down

0 comments on commit 07d86ca

Please sign in to comment.