]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ALSA: pcm: Free chmap at PCM free callback, too
authorTakashi Iwai <tiwai@suse.de>
Fri, 8 Jul 2016 06:23:43 +0000 (08:23 +0200)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:22:05 +0000 (17:22 -0500)
commit2a4f8b2b4983ce64ba27d2ca0d2b6fdbbff6559a
tree3458f902a067cdc7ee7790a795fdbf2c1865a0fd
parent9bfe293f21fbb95e9e37873bb54ebf23ad013647
ALSA: pcm: Free chmap at PCM free callback, too

Orabug: 25308105

[ Upstream commit a8ff48cb70835f48de5703052760312019afea55 ]

The chmap ctls assigned to PCM streams are freed in the PCM disconnect
callback.  However, since the disconnect callback isn't called when
the card gets freed before registering, the chmap ctls may still be
left assigned.  They are eventually freed together with other ctls,
but it may cause an Oops at pcm_chmap_ctl_private_free(), as the
function refers to the assigned PCM stream, while the PCM objects have
been already freed beforehand.

The fix is to free the chmap ctls also at PCM free callback, not only
at PCM disconnect.

Reported-by: Laxminath Kasam <b_lkasam@codeaurora.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
(cherry picked from commit 43506e749d3f8d7e012a1bc4cb57b18a03ecfee6)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
sound/core/pcm.c