Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1350381 > unrolled thread

[PATCH 2.6.32 51/55] ALSA: usb-audio: avoid freeing umidi object twice

Started byWilly Tarreau <w@1wt.eu>
First post2016-03-04 17:20 +0100
Last post2016-03-04 17:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2.6.32 51/55] ALSA: usb-audio: avoid freeing umidi object twice Willy Tarreau <w@1wt.eu> - 2016-03-04 17:20 +0100

#1350381 — [PATCH 2.6.32 51/55] ALSA: usb-audio: avoid freeing umidi object twice

FromWilly Tarreau <w@1wt.eu>
Date2016-03-04 17:20 +0100
Subject[PATCH 2.6.32 51/55] ALSA: usb-audio: avoid freeing umidi object twice
Message-ID<r90Cm-R6-15@gated-at.bofh.it>
2.6.32-longterm review patch.  If anyone has any objections, please let me know.

------------------

From: Andrey Konovalov <andreyknvl@gmail.com>

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 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
index 64d8d2e..366020a 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;
 	}
 
-- 
1.7.12.2.21.g234cd45.dirty

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web