Skip to contentSkip to conversation

nfc: pn533: properly drop the usb interface reference on disconnect

PATCH Applied Greg Kroah-Hartman 4 participants 7 messages Feb 23 – Feb 26

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfc: pn533: properly drop the usb interface reference on disconnect

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 <[email protected]>
Assisted-by gkh_clanker_2000
---
 drivers/nfc/pn533/usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nfc/pn533/usb.c +1 -0
index 018a80674f06..0f12f86ebb02 100644
@@ -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");
 }
Signature · 1 line
2.53.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Greg Kroah-Hartman

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 <[email protected]>
Assisted-by gkh_clanker_2000

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.

maintainer
#4 lore raw
In reply to Greg Kroah-Hartman
Quoted 1 line · 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?

#5 lore raw
Quoted 10 lines · Jakub Kicinski
Quoted 1 line · 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.

Quoted 2 lines

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

#2 lore raw
In reply to Simon Horman
Quoted 10 lines · Simon Horman
Quoted 8 lines · Greg Kroah-Hartman

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 <[email protected]>
Assisted-by gkh_clanker_2000
Quoted 6 lines

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 :)

Quoted 3 lines

That notwithstanding, this looks good to me.

thanks for the review!

greg k-h

reviewer
#3 lore raw
Quoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · Simon Horman
Quoted 8 lines · Greg Kroah-Hartman

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 <[email protected]>
Assisted-by gkh_clanker_2000

Hi Greg,

Quoted 7 lines
Quoted 4 lines

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.

Quoted 9 lines
Quoted 4 lines

That notwithstanding, this looks good to me.

thanks for the review!

greg k-h

#6 lore raw
In reply to Greg Kroah-Hartman
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Mon, 23 Feb 2026 12:28:30 +0100 you 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 <[email protected]>
Assisted-by gkh_clanker_2000

[...]

Here is the summary with links:
- [net] nfc: pn533: properly drop the usb interface reference on disconnect

    https://git.kernel.org/netdev/net/c/12133a483dfa

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html