diff options
| author | Vladis Dronov <vdronov@redhat.com> | 2016-03-31 12:05:43 -0400 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-11-17 12:13:09 +0100 |
| commit | fa566a66dc713cdf877376e44659b65dbddac7e4 (patch) | |
| tree | c6d846dff3628436f16bc6f6e05bbce93dd8316b /kernel | |
| parent | aa2bf4d5a1b72343be67623aadc462fba16d3184 (diff) | |
ALSA: usb-audio: Fix double-free in error paths after snd_usb_add_audio_stream() call
create_fixed_stream_quirk(), snd_usb_parse_audio_interface() and
create_uaxx_quirk() functions allocate the audioformat object by themselves
and free it upon error before returning. However, once the object is linked
to a stream, it's freed again in snd_usb_audio_pcm_free(), thus it'll be
double-freed, eventually resulting in a memory corruption.
This patch fixes these failures in the error paths by unlinking the audioformat
object before freeing it.
Based on a patch by Takashi Iwai <tiwai@suse.de>
[Note for stable backports:
this patch requires the commit 902eb7fd1e4a ('ALSA: usb-audio: Minor
code cleanup in create_fixed_stream_quirk()')]
Issue: CYNGNOS-3304
Change-Id: I1d4b48f35f3c7402f95615ea5d6beb7bd4ff2afb
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1283358
Reported-by: Ralf Spenneberg <ralf@spenneberg.net>
Cc: <stable@vger.kernel.org> # see the note above
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions
