From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: nbd@nbd.name, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wifi: mt76: mt7915: fix memory leak in mt7915_rate_txpower_get
Date: Mon, 16 Jan 2023 13:16:56 +0100 [thread overview]
Message-ID: <Y8VAOJmo89bn0qo1@lore-desk> (raw)
In-Reply-To: <2ea534ec17856f65237939f3d437aad37ddc7753.1672740921.git.lorenzo@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1339 bytes --]
> Fix possible memory leak in mt7915_rate_txpower_get routine if
> mt7915_mcu_get_txpower_sku() fails.
>
> Fixes: e3296759f347 ("wifi: mt76: mt7915: enable per bandwidth power limit support")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c
> index fb46c2c1784f..4730508652af 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c
> @@ -990,14 +990,14 @@ mt7915_rate_txpower_get(struct file *file, char __user *user_buf,
> char *buf;
> u32 reg;
>
> - buf = kzalloc(sz, GFP_KERNEL);
> - if (!buf)
> - return -ENOMEM;
> -
> ret = mt7915_mcu_get_txpower_sku(phy, txpwr, sizeof(txpwr));
> if (ret)
> return ret;
>
> + buf = kzalloc(sz, GFP_KERNEL);
> + if (!buf)
> + return -ENOMEM;
> +
> /* Txpower propagation path: TMAC -> TXV -> BBP */
> len += scnprintf(buf + len, sz - len,
> "\nPhy%d Tx power table (channel %d)\n",
> --
> 2.39.0
>
Felix,
It seems there is already a fix for it in your tree so we can drop this patch.
Regards,
Lorenzo
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2023-01-16 12:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 10:15 [PATCH] wifi: mt76: mt7915: fix memory leak in mt7915_rate_txpower_get Lorenzo Bianconi
2023-01-16 12:16 ` Lorenzo Bianconi [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=Y8VAOJmo89bn0qo1@lore-desk \
--to=lorenzo.bianconi@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
/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