mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
nfc: pn533: Fix error code in pn533_acr122_poweron_rdr()
[ Upstream commit 885bebac9909994050bbbeed0829c727e42bd1b7 ]
Set the error code if "transferred != sizeof(cmd)" instead of
returning success.
Fixes: dbafc28955 ("NFC: pn533: don't send USB data off of the stack")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aTfIJ9tZPmeUF4W1@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2f125ebe47
commit
8bc10b03e7
@@ -407,7 +407,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);
|
||||
|
||||
Reference in New Issue
Block a user