All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Changhuang Liang" <changhuang.liang@starfivetech.com>
Cc: linux-clk@vger.kernel.org
Subject: Re: [PATCH v2 1/6] clk: starfive: jh7110-sys: Fix memory leak in reset controller register
Date: Wed, 18 Nov 2026 10:10:20 +0000	[thread overview]
Message-ID: <sashiko-outbox-220658@kernel.org> (raw)
In-Reply-To: <20261118100523.11395-2-changhuang.liang@starfivetech.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] clk: starfive: inaccurate Fixes trailer in
  jh7110_reset_controller_register()
--

commit 49b17bd58c076121165de3046693949c43d724d8
Author: Changhuang Liang <changhuang.liang@starfivetech.com>

> clk: starfive: jh7110-sys: Fix memory leak in reset controller register
>
> auxiliary_device_init() returns an error before device_initialize() is
> called, so the release callback never runs on this path and the rdev
> allocated in jh7110_reset_controller_register() is leaked.
>
> Free rdev when auxiliary_device_init() fails.
>
> Fixes: edab7204afe5 ("clk: starfive: Add StarFive JH7110 system clock driver")
> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>

[Severity: Low]
Should the Fixes: tag point to d1aae0663023 ("clk: starfive: Avoid casting
iomem pointers") instead?

In edab7204afe5 ("clk: starfive: Add StarFive JH7110 system clock driver"),
adev was allocated with devm_kzalloc(), so it was freed automatically on
probe failure.  Commit d1aae0663023 ("clk: starfive: Avoid casting iomem
pointers") switched to kzalloc() and moved kfree(rdev) to
jh7110_reset_adev_release(), introducing the leak when
auxiliary_device_init() fails.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118100523.11395-1-changhuang.liang@starfivetech.com?part=1

  reply	other threads:[~2026-11-18 10:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 10:05 [PATCH v2 0/6] Add System-0 CRG for JHB100 SoC Changhuang Liang
2026-11-18 10:05 ` Changhuang Liang
2026-11-18 10:05 ` [PATCH v2 1/6] clk: starfive: jh7110-sys: Fix memory leak in reset controller register Changhuang Liang
2026-11-18 10:05   ` Changhuang Liang
2026-11-18 10:10   ` sashiko-bot [this message]
2026-11-18 10:05 ` [PATCH v2 2/6] clk: starfive: jh71x0: Move reset controller registration to jh71x0 common code Changhuang Liang
2026-11-18 10:05   ` Changhuang Liang
2026-11-18 10:05 ` [PATCH v2 3/6] clk: starfive: jh71x0: Add generic CRG probe helper Changhuang Liang
2026-11-18 10:05   ` Changhuang Liang
2026-11-18 10:05 ` [PATCH v2 4/6] clk: starfive: Add JHB100 System-0 clock generator driver Changhuang Liang
2026-11-18 10:05   ` Changhuang Liang
2026-11-18 10:05 ` [PATCH v2 5/6] reset: starfive: jh71x0: Support discontiguous reset IDs Changhuang Liang
2026-11-18 10:05   ` Changhuang Liang
2026-11-18 10:39   ` Philipp Zabel
2026-11-18 10:39     ` Philipp Zabel
2026-11-18 10:05 ` [PATCH v2 6/6] reset: starfive: Add StarFive JHB100 System-0 reset driver Changhuang Liang
2026-11-18 10:05   ` Changhuang Liang
2026-11-18 10:39   ` Philipp Zabel
2026-11-18 10:39     ` Philipp Zabel

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=sashiko-outbox-220658@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=changhuang.liang@starfivetech.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.