diff options
author | Andrey Konovalov <andreyknvl@gmail.com> | 2016-02-13 11:08:06 +0300 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2016-03-12 14:25:47 +0100 |
commit | b89babf8fdd0e3ac783ed3b13342121102f0d2af (patch) | |
tree | 4f4f2b2c3ea42a036c7e2db41b95509544a59d7b | |
parent | e66f21bdddfb9fc2591b44022f2d81a17d6c9f55 (diff) | |
download | lwn-b89babf8fdd0e3ac783ed3b13342121102f0d2af.tar.gz lwn-b89babf8fdd0e3ac783ed3b13342121102f0d2af.zip |
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>
-rw-r--r-- | sound/usb/usbmidi.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c index 64d8d2e6026d..366020a19d4b 100644 --- a/sound/usb/usbmidi.c +++ b/sound/usb/usbmidi.c @@ -1947,7 +1947,6 @@ int snd_usb_create_midi_interface(struct snd_usb_audio* chip, else err = snd_usbmidi_create_endpoints(umidi, endpoints); if (err < 0) { - snd_usbmidi_free(umidi); return err; } |