Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Cc: Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v3] gpio: Fix resource leaks on errors in gpiochip_add_data_with_key()
Date: Sat, 28 Feb 2026 21:21:16 +0800	[thread overview]
Message-ID: <aaLrzLBjUT6IqBiG@tzungbi-laptop> (raw)
In-Reply-To: <177218313069.8853.3389428325341696673.b4-ty@oss.qualcomm.com>

On Fri, Feb 27, 2026 at 10:08:19AM +0100, Bartosz Golaszewski wrote:
> 
> On Thu, 05 Feb 2026 09:28:40 +0000, Tzung-Bi Shih wrote:
> > Since commit aab5c6f20023 ("gpio: set device type for GPIO chips"),
> > `gdev->dev.release` is unset.  As a result, the reference count to
> > `gdev->dev` isn't dropped on the error handling paths.
> > 
> > Drop the reference on errors.
> > 
> > Also reorder the instructions to make the error handling simpler.
> > Now gpiochip_add_data_with_key() roughly looks like:
> > 
> > [...]
> 
> Hi Tzung-Bi!
> 
> For now I queued this for v7.1. I want it to spend some time in linux-next as
> I think it's a high-risk change. However, I preemptively put it into an
> immutable branch - if all is good for three weeks or so, I'll send it upstream
> for v7.0.
> 
> I see you added a Fixes tag dating back to 2024 and Cc'ed stable. I'm afraid
> this change will not apply very far back, do you plan to backport it all the
> way to v6.8?

Probably no, I think the patch won't apply very far back as well.  I added the
Fixes tag for providing context about the fix target.

      reply	other threads:[~2026-02-28 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05  9:28 [PATCH v3] gpio: Fix resource leaks on errors in gpiochip_add_data_with_key() Tzung-Bi Shih
2026-02-06  9:02 ` Bartosz Golaszewski
2026-02-27  9:08 ` Bartosz Golaszewski
2026-02-28 13:21   ` Tzung-Bi Shih [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=aaLrzLBjUT6IqBiG@tzungbi-laptop \
    --to=tzungbi@kernel.org \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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