mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] reset: Fix reset_control leak when put after controller unregister
Date: Thu, 05 Nov 2026 11:40:16 +0100	[thread overview]
Message-ID: <7fa397188daea5fcac036864534a4272cc2aef87.camel@pengutronix.de> (raw)
In-Reply-To: <20261104162038.48622-2-tzungbi@kernel.org>

On Do, 2026-11-05 at 00:20 +0800, Tzung-Bi Shih wrote:
> After commit 8c91302a29bc ("reset: protect struct reset_control with its
> own mutex"), reset_control_put_internal() returns early if `rcdev` is
> NULL.
> 
> When a reset controller is unregistered while consumers still hold
> reset_control handles, reset_controller_unregister() sets `rstc->rcdev`
> to NULL.  When consumers later release their handles via
> reset_control_put(), the early return skips kref_put(), resulting in
> leaking resources.
> 
> Call kref_put() in reset_control_put_internal() even if `rcdev` is NULL.
> 
> Fixes: 8c91302a29bc ("reset: protect struct reset_control with its own mutex")
> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

  parent reply	other threads:[~2026-11-05 10:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 16:20 [PATCH v2 0/2] reset: Fix issues reported by Sashiko Tzung-Bi Shih
2026-11-04 16:20 ` [PATCH v2 1/2] reset: Fix reset_control leak when put after controller unregister Tzung-Bi Shih
2026-11-04 17:38   ` Markus Elfring
2026-11-05 10:40   ` Philipp Zabel [this message]
2026-11-04 16:20 ` [PATCH v2 2/2] reset: Fix circular locking dependency in reset_controller_unregister() Tzung-Bi Shih
2026-11-05 10:40   ` Philipp Zabel
2026-11-05  9:16 ` [PATCH v2 0/2] reset: Fix issues reported by Sashiko Bartosz Golaszewski
2026-11-05 11:08 ` 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=7fa397188daea5fcac036864534a4272cc2aef87.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tzungbi@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

all inboxes | Powered by JetHome®