[prev in list] [next in list] [prev in thread] [next in thread] 

List:       alsa-devel
Subject:    Re: [PATCH 1/2] ASoC: mediatek: mt8188: fix use-after-free in driver remove path
From:       Doug Anderson <dianders () chromium ! org>
Date:       2023-05-31 23:47:56
Message-ID: CAD=FV=X1JURLwZHraNwSMT7vwLNRNw7h0MmpbeWnr1yht6-3VA () mail ! gmail ! com
[Download RAW message or body]

Hi,

On Tue, May 30, 2023 at 12:25 AM Trevor Wu <trevor.wu@mediatek.com> wrote:
> 
> diff --git a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c \
> b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c index be1c53bf4729..05d6f9d78e10 \
>                 100644
> --- a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c
> +++ b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c
> @@ -138,6 +138,29 @@ static const struct afe_gate aud_clks[CLK_AUD_NR_CLK] = {
> GATE_AUD6(CLK_AUD_GASRC11, "aud_gasrc11", "top_asm_h", 11),
> };
> 
> +static void mt8188_audsys_clk_unregister(void *data)
> +{
> +       struct mtk_base_afe *afe = (struct mtk_base_afe *)data;

The above cast is unnecessary since the compiler lets you assign from
a "void *" to another pointer without a cast. Unnecessary casts are
considered harmful because they suspend the compiler's ability to do
type checking. Other than that, this looks good. Sorry for not
noticing that the same problem affected more than just the driver I
fixed previously.

Reviewed-by: Douglas Anderson <dianders@chromium.org>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic