Re: [PATCH 2/2] ASoC: mediatek: mt8195: fix use-after-free in driver remove path

From: Trevor Wu (吳文良)
Date: Wed May 31 2023 - 22:22:06 EST


On Wed, 2023-05-31 at 16:47 -0700, Doug Anderson wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> Hi,
>
> On Tue, May 30, 2023 at 12:25 AM Trevor Wu <trevor.wu@xxxxxxxxxxxx>
> wrote:
> >
> > diff --git a/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c
> b/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c
> > index e0670e0dbd5b..09bd1a020421 100644
> > --- a/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c
> > +++ b/sound/soc/mediatek/mt8195/mt8195-audsys-clk.c
> > @@ -148,6 +148,29 @@ static const struct afe_gate
> aud_clks[CLK_AUD_NR_CLK] = {
> > GATE_AUD6(CLK_AUD_GASRC19, "aud_gasrc19", "top_asm_h", 19),
> > };
> >
> > +static void mt8195_audsys_clk_unregister(void *data)
> > +{
> > + struct mtk_base_afe *afe = (struct mtk_base_afe *)data;
>
> Same as in patch #1, the above cast isn't necessary. Other than that:
>
> Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>

OK, I will remove the cast in V2.

Thanks,
Trevor