Skip to content

Commit 2195f20

Browse files
krzkdavem330
authored andcommitted
nfc: port100: fix using -ERRNO as command type mask
During probing, the driver tries to get a list (mask) of supported command types in port100_get_command_type_mask() function. The value is u64 and 0 is treated as invalid mask (no commands supported). The function however returns also -ERRNO as u64 which will be interpret as valid command mask. Return 0 on every error case of port100_get_command_type_mask(), so the probing will stop. Cc: <stable@vger.kernel.org> Fixes: 0347a6a ("NFC: port100: Commands mechanism implementation") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent eacd68b commit 2195f20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/nfc/port100.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,11 +1006,11 @@ static u64 port100_get_command_type_mask(struct port100 *dev)
10061006

10071007
skb = port100_alloc_skb(dev, 0);
10081008
if (!skb)
1009-
return -ENOMEM;
1009+
return 0;
10101010

10111011
resp = port100_send_cmd_sync(dev, PORT100_CMD_GET_COMMAND_TYPE, skb);
10121012
if (IS_ERR(resp))
1013-
return PTR_ERR(resp);
1013+
return 0;
10141014

10151015
if (resp->len < 8)
10161016
mask = 0;

0 commit comments

Comments
 (0)