From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 187C127281D; Sat, 28 Feb 2026 13:21:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772284880; cv=none; b=M9jZrUInaVCZbZmNVmEkZU83/IMWnV3RUtgGukF8Hja3LDRw4DsHSVYhQqIRvz1FFJTRhRUFXfoaLU5UtbJRxIMU6h322kRFNePuuCuvyhkWZHyhFXExm3aDJnR/gmx8/xNc1dxlvVEsFi4EmMUVOqPLKsGyozMFD4Xi+uVu4fU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772284880; c=relaxed/simple; bh=ncaklDM+xxv5o6yR5ZjBDMMWru15gW5O4oJBGdc0wRE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Flr+Och6oPC5W/a4MswwlFYgJpXViYZeOISSndqPHYxWkFgRYXNv3zTkYM35Wy+O1bfsjjeCOQbTOm2l9xelt6Q7pF2FiD9nDmoFFXbPNsqyyz/NknfjXLVHFfvdZZo5JgfMaOUzQ2rPcqvFCETu6pDwc/fcqjrZuBg2vde+IiY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=djwar9JH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="djwar9JH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0DD6C116D0; Sat, 28 Feb 2026 13:21:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772284879; bh=ncaklDM+xxv5o6yR5ZjBDMMWru15gW5O4oJBGdc0wRE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=djwar9JHBz4ZBnWfwVfBUojW2G4kNb37zsXhqlDhhX1zttvC8rS3WMfPRXVayBb2m zWQe0JJhsg1hev3Js8512V2S5oANZGp5J6XJHGMzJf7E/+XA50qeO2OBKBxPcJNcdj qXnjsACpErRpbvfJdHHm6m9onWZxQDEhTcYAVXjmKeM8RjK50LtlHr/ZmA3F6zl9VJ 5qHaKslP6LubHmMvGwR7KYYTWPQacpRkzTNw7AOXUnhjQUYea7D3NIQyE/mCA6H2Vi jG1JY5c8IdKctLV8phWgFWJQI7zXSWVu7h+gM55ua0TCFLbSmwq3+e+7HzeAo3/siR pIzYEXPqGzTAA== Date: Sat, 28 Feb 2026 21:21:16 +0800 From: Tzung-Bi Shih To: Bartosz Golaszewski Cc: Linus Walleij , Bartosz Golaszewski , 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() Message-ID: References: <20260205092840.2574840-1-tzungbi@kernel.org> <177218313069.8853.3389428325341696673.b4-ty@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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.