From: Kalle Valo <kvalo@kernel.org>
To: Ma Ke <make24@iscas.ac.cn>
Cc: nbd@nbd.name, lorenzo@kernel.org, ryder.lee@mediatek.com,
shayne.chen@mediatek.com, sean.wang@mediatek.com,
matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,
mingyen.hsieh@mediatek.com, deren.wu@mediatek.com,
ruanjinjie@huawei.com, greearb@candelatech.com,
akpm@linux-foundation.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, stable@vger.kernel.org
Subject: Re: [PATCH RESEND] wifi: mt76: mt7921: Check devm_kasprintf() returned value
Date: Tue, 03 Sep 2024 10:50:54 +0300 [thread overview]
Message-ID: <87wmjtjhup.fsf@kernel.org> (raw)
In-Reply-To: <20240903014455.4144536-1-make24@iscas.ac.cn> (Ma Ke's message of "Tue, 3 Sep 2024 09:44:55 +0800")
Ma Ke <make24@iscas.ac.cn> writes:
> devm_kasprintf() can return a NULL pointer on failure but this returned
> value is not checked. Fix this lack and check the returned value.
>
> Found by code review.
>
> Cc: stable@vger.kernel.org
> Fixes: 6ae39b7c7ed4 ("wifi: mt76: mt7921: Support temp sensor")
> Signed-off-by: Ma Ke <make24@iscas.ac.cn>
> ---
> drivers/net/wireless/mediatek/mt76/mt7921/init.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> index ef0c721d26e3..5ab395d9d93e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> @@ -52,6 +52,8 @@ static int mt7921_thermal_init(struct mt792x_phy *phy)
>
> name = devm_kasprintf(&wiphy->dev, GFP_KERNEL, "mt7921_%s",
> wiphy_name(wiphy));
> + if (!name)
> + return -ENOMEM;
>
> hwmon = devm_hwmon_device_register_with_groups(&wiphy->dev, name, phy,
> mt7921_hwmon_groups);
You sent the previous version of this on August 26th:
https://patchwork.kernel.org/project/linux-wireless/patch/20240826095535.2603538-1-make24@iscas.ac.cn/
Please stop spamming like this and understand that maintainers are busy.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
https://docs.kernel.org/process/submitting-patches.html
next prev parent reply other threads:[~2024-09-03 7:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 1:44 [PATCH RESEND] wifi: mt76: mt7921: Check devm_kasprintf() returned value Ma Ke
2024-09-03 7:50 ` Kalle Valo [this message]
2024-09-04 9:00 ` Matthias Brugger
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=87wmjtjhup.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=deren.wu@mediatek.com \
--cc=greearb@candelatech.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=make24@iscas.ac.cn \
--cc=matthias.bgg@gmail.com \
--cc=mingyen.hsieh@mediatek.com \
--cc=nbd@nbd.name \
--cc=ruanjinjie@huawei.com \
--cc=ryder.lee@mediatek.com \
--cc=sean.wang@mediatek.com \
--cc=shayne.chen@mediatek.com \
--cc=stable@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).