Skip to content

Commit

Permalink
ALSA: usb-audio: avoid freeing umidi object twice
Browse files Browse the repository at this point in the history
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.

Change-Id: I8534867beeac111370017ef246adc17e23e1a3b1
Signed-off-by: Andrey Konovalov <andreyknvl@gmail.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
xairy authored and hurtsky committed May 15, 2016
1 parent 788abb7 commit 82262a2
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion sound/usb/midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2252,7 +2252,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;
}

Expand Down

0 comments on commit 82262a2

Please sign in to comment.