Commit 05dd81ea authored by Andrey Konovalov's avatar Andrey Konovalov Committed by Greg Kroah-Hartman

ALSA: usb-audio: avoid freeing umidi object twice

commit 07d86ca9 upstream.

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: default avatarAndrey Konovalov <andreyknvl@gmail.com>
Acked-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fa11d6e5
...@@ -2365,7 +2365,6 @@ int snd_usbmidi_create(struct snd_card *card, ...@@ -2365,7 +2365,6 @@ int snd_usbmidi_create(struct snd_card *card,
else else
err = snd_usbmidi_create_endpoints(umidi, endpoints); err = snd_usbmidi_create_endpoints(umidi, endpoints);
if (err < 0) { if (err < 0) {
snd_usbmidi_free(umidi);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment