From: Krzysztof Kozlowski <krzk@kernel.org>
To: "zhen.ni" <zhen.ni@easystack.cn>, alim.akhtar@samsung.com
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH] memory: samsung: exynos-srom: Fix of_iomap leak in exynos_srom_probe
Date: Thu, 31 Jul 2025 12:59:43 +0200 [thread overview]
Message-ID: <0774bf0f-5686-46ab-bd71-82b859201353@kernel.org> (raw)
In-Reply-To: <5b4dc6a3-f6fd-4bf7-a84e-3d79db8d062e@easystack.cn>
On 31/07/2025 11:40, zhen.ni wrote:
> Hi,
>
> During static analysis with Smatch, I identified the following issue:
>
> ```
> drivers/memory/samsung/exynos-srom.c:155 exynos_srom_probe()
> warn: 'srom->reg_base' from of_iomap() not released on lines: 155.
Nothing in commit msg explained you used Smatch. You must describe the
tools you use.
> ```
>
> Problem analysis:
> 1. In exynos_srom_probe(), the reg_base resource is acquired via of_iomap()
> 2. The of_platform_populate() call at the end of the function has a
> possible failure path:
Above is AI/LLM output?
> ```
> root = root ? of_node_get(root) : of_find_node_by_path("/");
> if (!root)
> return -EINVAL; // Failure return point
> ```
> 3. When this path is taken, reg_base is not released, causing a resource
> leak
>
> Verification:
> After applying the patch, the Smatch warning is resolved
This means no testing. You should mention it as well.
Don't top post. See netiquette.
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-07-31 10:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-31 8:33 Zhen Ni
2025-07-31 9:06 ` Krzysztof Kozlowski
2025-07-31 9:40 ` zhen.ni
2025-07-31 10:59 ` Krzysztof Kozlowski [this message]
2025-08-06 2:55 ` [PATCH v2] " Zhen Ni
2025-08-13 10:30 ` Krzysztof Kozlowski
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=0774bf0f-5686-46ab-bd71-82b859201353@kernel.org \
--to=krzk@kernel.org \
--cc=alim.akhtar@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=zhen.ni@easystack.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®