mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@kernel.org>
To: tze.yee.ng@altera.com, Richard Gong <richard.gong@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alan Tull <atull@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] firmware: stratix10-svc: fix memory leaks and list corruption bugs
Date: Mon, 6 Jul 2026 18:08:09 -0500	[thread overview]
Message-ID: <a41ab72a-b18e-495b-916e-16d7e70ccfe6@kernel.org> (raw)
In-Reply-To: <7f1bfc5d40ec63b41cf85efdc702ecf53c99a5c9.1782295465.git.tze.yee.ng@altera.com>



On 6/24/26 05:06, tze.yee.ng@altera.com wrote:
> From: Tze Yee Ng <tze.yee.ng@altera.com>
> 
> Fix a memory leak when gen_pool_alloc() fails by freeing pmem on the error
> path. Switch pmem allocation from devm_kzalloc() to kzalloc() with
> explicit kfree() in the free path to match its list-managed lifetime.
> Remove the erroneous list_del(&svc_data_mem) which corrupted the list head
> on failed lookups.
> 
> Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
> Cc: stable@vger.kernel.org # 5.0+
> Signed-off-by: Tze Yee Ng <tze.yee.ng@altera.com>
> ---
> Changes in v3:
> - Remove blank line before Signed-off-by.
> - No code changes.
> 
> Changes in v2:
> - Remove if (!chan || !kaddr) early return from stratix10_svc_free_memory()
>    per review; failed lookup is handled by dropping list_del(&svc_data_mem).
> - Add Cc: stable@vger.kernel.org # 5.0+.
> - Minor commit message cleanup (lifetime spelling, subject line).
> ---
>   drivers/firmware/stratix10-svc.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
> index 00e134e663c8..ccf57dfd9a2d 100644
> --- a/drivers/firmware/stratix10-svc.c
> +++ b/drivers/firmware/stratix10-svc.c

Applied!

Thanks,
Dinh

      reply	other threads:[~2026-07-06 23:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24 10:06 tze.yee.ng
2026-07-06 23:08 ` Dinh Nguyen [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=a41ab72a-b18e-495b-916e-16d7e70ccfe6@kernel.org \
    --to=dinguyen@kernel.org \
    --cc=atull@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.gong@intel.com \
    --cc=tze.yee.ng@altera.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome