mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Zilin Guan <zilin@seu.edu.cn>, chunkeey@googlemail.com
Cc: quic_rdevanat@quicinc.com, linux-wireless@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wifi: p54: Fix memory leak in p54_beacon_update()
Date: Tue, 20 Jan 2026 09:16:05 +0100	[thread overview]
Message-ID: <01724c7be8e023f6b5cd0ac6b48c3e125bc1fd9b.camel@sipsolutions.net> (raw)
In-Reply-To: <20260119113145.1433315-1-zilin@seu.edu.cn> (sfid-20260119_123712_933163_D9FDF740)

On Mon, 2026-01-19 at 11:31 +0000, Zilin Guan wrote:
> In p54_beacon_update(), beacon is allocated via ieee80211_beacon_get().
> If p54_beacon_format_ie_tim() fails, the function returns immediately
> without freeing the allocated beacon skb, leading to a memory leak.
> 
> Since no other references to this memory exist, it must be freed locally
> before returning the error. Fix this by freeing the buffer using
> dev_kfree_skb_any() in the error path.
> 
> Compile tested only. Issue found using a prototype static analysis tool
> and code review.
> 
> Fixes: 0ac0d6cedf61 ("p54: Move mac80211 glue code")

That doesn't seem right, although that commit didn't really "move" code,
it added unused code ... but I think that it probably could go further
back.

johannes

  reply	other threads:[~2026-01-20  8:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19 11:31 Zilin Guan
2026-01-20  8:16 ` Johannes Berg [this message]
2026-01-20 12:47   ` Zilin Guan

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=01724c7be8e023f6b5cd0ac6b48c3e125bc1fd9b.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=chunkeey@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_rdevanat@quicinc.com \
    --cc=zilin@seu.edu.cn \
    /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

all inboxes | Powered by JetHome®