mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 07:35:36 -05:00
nfc: pn533: Fix error code in pn533_acr122_poweron_rdr()
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>
This commit is contained in:
committed by
Jakub Kicinski
parent
5914428e0e
commit
885bebac99
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user