Skip to content

Commit 885beba

Browse files
Dan Carpenterkuba-moo
authored andcommitted
nfc: pn533: Fix error code in pn533_acr122_poweron_rdr()
Set the error code if "transferred != sizeof(cmd)" instead of returning success. Fixes: dbafc28 ("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>
1 parent 5914428 commit 885beba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nfc/pn533/usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static int pn533_acr122_poweron_rdr(struct pn533_usb_phy *phy)
406406
if (rc || (transferred != sizeof(cmd))) {
407407
nfc_err(&phy->udev->dev,
408408
"Reader power on cmd error %d\n", rc);
409-
return rc;
409+
return rc ?: -EINVAL;
410410
}
411411

412412
rc = usb_submit_urb(phy->in_urb, GFP_KERNEL);

0 commit comments

Comments
 (0)