midi: avoid freeing umidi object twice
Subsystems (2)
PATCH 1/1 midi: 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.
Acked-by Clemens Ladisch <[email protected]>
Signed-off-by Andrey Konovalov <[email protected]>
--- sound/usb/midi.c | 1 - 1 file changed, 1 deletion(-)
sound/usb/midi.c +0 -1
@@ -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; }
Signature · 1 line
1.9.1
Takashi Iwai
AppliedQuoted 9 lines · Andrey Konovalov
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 insnd_usbmidi_create()after having registered the rawmidi interface.Found by KASAN.
Acked-by Clemens Ladisch <[email protected]>Signed-off-by Andrey Konovalov <[email protected]>
Thanks, applied now with Cc to stable.
Takashi
Quoted 20 lines
--- sound/usb/midi.c | 1 - 1 file changed, 1 deletion(-)sound/usb/midi.c +0
-1@@ -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; }Signature · 1 line
1.9.1