UPSTREAM: 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.

Signed-off-by: Andrey Konovalov <>
Acked-by: Clemens Ladisch <>
Cc: <>
Signed-off-by: Takashi Iwai <>

Bug: 27300729

(cherry picked from commit 07d86ca93db7e5cdf4743564d98292042ec21af7)
Signed-off-by: Kees Cook <>
Change-Id: I1b68e347c30a72e3393ae359aeec15ec453d4e7b
1 file changed