From: Lyude Paul <lyude.paul@maintainer.cc>
To: Haoxiang Li <haoxiang_li2024@163.com>,
dakr@kernel.org, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
simona@ffwll.ch, martin.peres@free.fr, nouveau@karolherbst.de
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/nouveau/iccsense: Free temporary BIOS rail table
Date: Thu, 03 Dec 2026 20:24:17 -0500 [thread overview]
Message-ID: <333d391a5633f5b2e0d6b616c825a41d1fd65ac9.camel@maintainer.cc> (raw)
In-Reply-To: <20261119041556.2837468-1-haoxiang_li2024@163.com>
Reviewed-by: Lyude Paul <lyude.paul@maintainer.cc>
Will push to drm-misc-next in a moment
On Thu, 2026-11-19 at 12:15 +0800, Haoxiang Li wrote:
> nvbios_iccsense_parse() allocates stbl.rail, but never releases it,
> leaking the allocation both on successful initialization and when
> allocating a runtime rail fails.
>
> The sensor and runtime rail objects store copies of the parsed
> fields, so the temporary table is not owned or freed by the
> subdevice destructor.
>
> Free stbl.rail after processing the entries and before returning
> on runtime rail allocation failure.
>
> Fixes: b71c0892631a ("drm/nouveau/iccsense: implement for ina209,
> ina219 and ina3221")
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
> ---
> drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
> index 3ccdbbe2fad0..85fd891442e4 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
> @@ -280,8 +280,10 @@ nvkm_iccsense_oneinit(struct nvkm_subdev
> *subdev)
> }
>
> rail = kmalloc_obj(*rail);
> - if (!rail)
> + if (!rail) {
> + kfree(stbl.rail);
> return -ENOMEM;
> + }
>
> rail->read = read;
> rail->sensor = sensor;
> @@ -291,6 +293,7 @@ nvkm_iccsense_oneinit(struct nvkm_subdev *subdev)
> list_add_tail(&rail->head, &iccsense-
> >rails);
> }
> }
> + kfree(stbl.rail);
> return 0;
> }
>
prev parent reply other threads:[~2026-12-04 1:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 4:15 Haoxiang Li
2026-12-04 1:24 ` Lyude Paul [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=333d391a5633f5b2e0d6b616c825a41d1fd65ac9.camel@maintainer.cc \
--to=lyude.paul@maintainer.cc \
--cc=airlied@gmail.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=haoxiang_li2024@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=martin.peres@free.fr \
--cc=mripard@kernel.org \
--cc=nouveau@karolherbst.de \
--cc=nouveau@lists.freedesktop.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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®