ALSA: usb-audio: avoid freeing umidi object twice
authorAndrey Konovalov <andreyknvl@gmail.com>
Sat, 13 Feb 2016 08:08:06 +0000 (11:08 +0300)
committerWilly Tarreau <w@1wt.eu>
Sat, 12 Mar 2016 13:25:47 +0000 (14:25 +0100)
commitb89babf8fdd0e3ac783ed3b13342121102f0d2af
tree4f4f2b2c3ea42a036c7e2db41b95509544a59d7b
parente66f21bdddfb9fc2591b44022f2d81a17d6c9f55
ALSA: usb-audio: avoid freeing umidi object twice

commit 07d86ca93db7e5cdf4743564d98292042ec21af7 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: Andrey Konovalov <andreyknvl@gmail.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
[wt: file is sound/midi/usbmidi.c in 2.6.32]
Signed-off-by: Willy Tarreau <w@1wt.eu>
sound/usb/usbmidi.c