[PATCH net] nfc: pn533: properly drop the usb interface reference on disconnect

Greg Kroah-Hartman posted 1 patch 1 month, 3 weeks ago
drivers/nfc/pn533/usb.c | 1 +
1 file changed, 1 insertion(+)
[PATCH net] nfc: pn533: properly drop the usb interface reference on disconnect
Posted by Greg Kroah-Hartman 1 month, 3 weeks ago
When the device is disconnected from the driver, there is a "dangling"
reference count on the usb interface that was grabbed in the probe
callback.  Fix this up by properly dropping the reference after we are
done with it.

Cc: stable <stable@kernel.org>
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/nfc/pn533/usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nfc/pn533/usb.c b/drivers/nfc/pn533/usb.c
index 018a80674f06..0f12f86ebb02 100644
--- a/drivers/nfc/pn533/usb.c
+++ b/drivers/nfc/pn533/usb.c
@@ -628,6 +628,7 @@ static void pn533_usb_disconnect(struct usb_interface *interface)
 	usb_free_urb(phy->out_urb);
 	usb_free_urb(phy->ack_urb);
 	kfree(phy->ack_buffer);
+	usb_put_dev(phy->udev);
 
 	nfc_info(&interface->dev, "NXP PN533 NFC device disconnected\n");
 }
-- 
2.53.0
Re: [PATCH net] nfc: pn533: properly drop the usb interface reference on disconnect
Posted by Jakub Kicinski 1 month, 3 weeks ago
On Mon, 23 Feb 2026 12:28:30 +0100 Greg Kroah-Hartman wrote:
> Assisted-by: gkh_clanker_2000

I feel like this tag completely validates my position that the whole
Assisted-by tag is nonsense. Random "Person X's bot" tags cannot help
any cross-kernel research into problems with AI coding tools. And all
of us, employees of AI-pilled companies, are routinely using a whole
slew of AI-backed tools on our kernel submissions. Which cannot be
practically captured by such tags, since they are evolving rapidly.

Are you okay with me stripping these when I apply your patches?
Or do you strongly prefer to keep them?
Re: [PATCH net] nfc: pn533: properly drop the usb interface reference on disconnect
Posted by Greg Kroah-Hartman 1 month, 2 weeks ago
On Tue, Feb 24, 2026 at 05:42:03PM -0800, Jakub Kicinski wrote:
> On Mon, 23 Feb 2026 12:28:30 +0100 Greg Kroah-Hartman wrote:
> > Assisted-by: gkh_clanker_2000
> 
> I feel like this tag completely validates my position that the whole
> Assisted-by tag is nonsense. Random "Person X's bot" tags cannot help
> any cross-kernel research into problems with AI coding tools. And all
> of us, employees of AI-pilled companies, are routinely using a whole
> slew of AI-backed tools on our kernel submissions. Which cannot be
> practically captured by such tags, since they are evolving rapidly.
> 
> Are you okay with me stripping these when I apply your patches?
> Or do you strongly prefer to keep them?

No objection from stripping it at all.  My tooling has no feelings
whatsoever and are not trying to justify an inflated market validation
with advertising their use and so will not even notice. :)

I added it to show that I did have "help" in finding the location for
where to do this type of fix, I didn't just pull it out of thin air on
my own.

thanks,

greg k-h
Re: [PATCH net] nfc: pn533: properly drop the usb interface reference on disconnect
Posted by Simon Horman 1 month, 3 weeks ago
On Mon, Feb 23, 2026 at 12:28:30PM +0100, Greg Kroah-Hartman wrote:
> When the device is disconnected from the driver, there is a "dangling"
> reference count on the usb interface that was grabbed in the probe
> callback.  Fix this up by properly dropping the reference after we are
> done with it.
> 
> Cc: stable <stable@kernel.org>
> Assisted-by: gkh_clanker_2000
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Hi Greg,

As a fix, a Fixes tag seems appropriate.
This seems to have been there since the beginning, so perhaps this one:

Fixes: c46ee38620a2 ("NFC: pn533: add NXP pn533 nfc device driver")

That notwithstanding, this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>
Re: [PATCH net] nfc: pn533: properly drop the usb interface reference on disconnect
Posted by Greg Kroah-Hartman 1 month, 2 weeks ago
On Tue, Feb 24, 2026 at 09:17:00AM +0000, Simon Horman wrote:
> On Mon, Feb 23, 2026 at 12:28:30PM +0100, Greg Kroah-Hartman wrote:
> > When the device is disconnected from the driver, there is a "dangling"
> > reference count on the usb interface that was grabbed in the probe
> > callback.  Fix this up by properly dropping the reference after we are
> > done with it.
> > 
> > Cc: stable <stable@kernel.org>
> > Assisted-by: gkh_clanker_2000
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Hi Greg,
> 
> As a fix, a Fixes tag seems appropriate.
> This seems to have been there since the beginning, so perhaps this one:
> 
> Fixes: c46ee38620a2 ("NFC: pn533: add NXP pn533 nfc device driver")

Fair enough, I don't normally add Fixes: tags for my stuff as it's me
doing the backports to stable kernels once they hit Linus's tree :)

> That notwithstanding, this looks good to me.
> 
> Reviewed-by: Simon Horman <horms@kernel.org>

thanks for the review!

greg k-h
Re: [PATCH net] nfc: pn533: properly drop the usb interface reference on disconnect
Posted by Simon Horman 1 month, 2 weeks ago
On Wed, Feb 25, 2026 at 06:31:12AM -0800, Greg Kroah-Hartman wrote:
> On Tue, Feb 24, 2026 at 09:17:00AM +0000, Simon Horman wrote:
> > On Mon, Feb 23, 2026 at 12:28:30PM +0100, Greg Kroah-Hartman wrote:
> > > When the device is disconnected from the driver, there is a "dangling"
> > > reference count on the usb interface that was grabbed in the probe
> > > callback.  Fix this up by properly dropping the reference after we are
> > > done with it.
> > > 
> > > Cc: stable <stable@kernel.org>
> > > Assisted-by: gkh_clanker_2000
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > 
> > Hi Greg,
> > 
> > As a fix, a Fixes tag seems appropriate.
> > This seems to have been there since the beginning, so perhaps this one:
> > 
> > Fixes: c46ee38620a2 ("NFC: pn533: add NXP pn533 nfc device driver")
> 
> Fair enough, I don't normally add Fixes: tags for my stuff as it's me
> doing the backports to stable kernels once they hit Linus's tree :)

Understood. For review of Networking patches it is something we look out
for, which is the main reason I flagged it. But I take your point about
you being the consumer of those tags.

> 
> > That notwithstanding, this looks good to me.
> > 
> > Reviewed-by: Simon Horman <horms@kernel.org>
> 
> thanks for the review!
> 
> greg k-h
>