All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "HyeongJun An" <sammiee5311@gmail.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH] ASoC: fsl_easrc: Set firmware_loaded only after a successful resume
Date: Tue, 01 Dec 2026 14:48:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-243525@kernel.org> (raw)
In-Reply-To: <20261201143357.2034973-1-sammiee5311@gmail.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] ASoC: fsl_easrc: firmware memory leak in
  fsl_easrc_get_firmware() [1]
--

commit 87f601aeb8732163a051c010051d750b2c2a81db
Author: HyeongJun An <sammiee5311@gmail.com>

ASoC: fsl_easrc: Set firmware_loaded only after a successful resume

This commit defers setting easrc_priv->firmware_loaded in
fsl_easrc_runtime_resume() until after the firmware has been fetched and
the coefficients have been configured.

> diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
> index b7a429170794f..1765e46ba5a47 100644
> --- a/sound/soc/fsl/fsl_easrc.c
> +++ b/sound/soc/fsl/fsl_easrc.c
> @@ -2386,7 +2386,6 @@ static int fsl_easrc_runtime_resume(struct device *dev)
>  	scoped_guard(spinlock_irqsave, &easrc->lock) {
>  		if (easrc_priv->firmware_loaded)
>  			return 0;
> -		easrc_priv->firmware_loaded = 1;
>  	}
>  
>  	ret = fsl_easrc_get_firmware(easrc);

[Severity: High]
This problem wasn't introduced by this patch, but does
fsl_easrc_get_firmware() leak easrc_priv->fw [1]?

fsl_easrc_get_firmware() calls request_firmware(&easrc_priv->fw, ...),
and the driver never calls release_firmware().  Because
fsl_easrc_runtime_suspend() clears easrc_priv->firmware_loaded, every
subsequent runtime resume calls fsl_easrc_get_firmware() again and
overwrites easrc_priv->fw, leaking the previous firmware allocation on
each suspend/resume cycle as well as on driver removal.

[1] https://sashiko.dev/#/bug/linux-55cff098-2f82-47eb-bc04-f484dfe8d953

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201143357.2034973-1-sammiee5311@gmail.com?part=1

      reply	other threads:[~2026-12-01 14:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 14:33 [PATCH] ASoC: fsl_easrc: Set firmware_loaded only after a successful resume HyeongJun An
2026-12-01 14:48 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-243525@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=sammiee5311@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.