lkml.org 
[lkml]   [2024]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ALSA: hda/cs_dsp_ctl: Use private_free for control cleanup
On Wed, 08 May 2024 11:56:27 +0200,
Richard Fitzgerald wrote:
>
> Use the control private_free callback to free the associated data
> block. This ensures that the memory won't leak, whatever way the
> control gets destroyed.
>
> The original implementation didn't actually remove the ALSA
> controls in hda_cs_dsp_control_remove(). It only freed the internal
> tracking structure. This meant it was possible to remove/unload the
> amp driver while leaving its ALSA controls still present in the
> soundcard. Obviously attempting to access them could cause segfaults
> or at least dereferencing stale pointers.
>
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> Fixes: 3233b978af23 ("ALSA: hda: hda_cs_dsp_ctl: Add Library to support CS_DSP ALSA controls")
> ---
> This replaces my earlier "keep it simple" attempt at cleanup.
> I decided that implementing private_free is the only sensible
> way to fix the cleanup.

Applied now. Thanks.


Takashi

\
 
 \ /
  Last update: 2024-05-08 14:33    [W:0.044 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site