Skip to contentSkip to conversation

nfc: pn533: Fix error code in pn533_acr122_poweron_rdr()

PATCH Applied Dan Carpenter 3 participants 3 messages Dec 9, 2025 – Dec 11, 2025

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

PATCH 1/1 nfc: pn533: Fix error code in pn533_acr122_poweron_rdr()

Set the error code if "transferred != sizeof(cmd)" instead of returning success.

Fixes dbafc28955fa ("NFC: pn533: don't send USB data off of the stack")
---
 drivers/nfc/pn533/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nfc/pn533/usb.c +1 -1
index ffd7367ce119..018a80674f06 100644
@@ -406,7 +406,7 @@ static int pn533_acr122_poweron_rdr(struct pn533_usb_phy *phy)
 	if (rc || (transferred != sizeof(cmd))) {
 		nfc_err(&phy->udev->dev,
 			"Reader power on cmd error %d\n", rc);
-		return rc;
+		return rc ?: -EINVAL;
 	}
 
 	rc =  usb_submit_urb(phy->in_urb, GFP_KERNEL);
Signature · 1 line
2.51.0
#1 lore raw
Quoted 8 lines · Dan Carpenter

Set the error code if "transferred != sizeof(cmd)" instead of returning success.

Fixes dbafc28955fa ("NFC: pn533: don't send USB data off of the stack")
---
 drivers/nfc/pn533/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Why to me? I'm not the maintainer of NFC that I know of :)

And shouldn't this also cc: stable?

thanks,

greg k-h

#2 lore raw
In reply to Dan Carpenter
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 8 lines · On Tue, 9 Dec 2025 09:56:39 +0300 you wrote:

Set the error code if "transferred != sizeof(cmd)" instead of returning success.

Fixes dbafc28955fa ("NFC: pn533: don't send USB data off of the stack")
---
 drivers/nfc/pn533/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [net] nfc: pn533: Fix error code in pn533_acr122_poweron_rdr()

    https://git.kernel.org/netdev/net/c/885bebac9909

You are awesome, thank you!

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