summaryrefslogtreecommitdiff
path: root/drivers/nfc
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-05-28 15:41:54 +0300
committerJakub Kicinski <kuba@kernel.org>2021-05-29 01:05:55 +0300
commit41a6bf50ee04a604f84ba8989055781d68061ed6 (patch)
tree1b50a7c6ff3bf2d75d8a41bfa677bb118d3f6d89 /drivers/nfc
parent26f20ff5e207ed87340fc574cb3b360a2581272c (diff)
downloadlinux-41a6bf50ee04a604f84ba8989055781d68061ed6.tar.xz
nfc: mrvl: skip impossible NCI_MAX_PAYLOAD_SIZE check
The nci_ctrl_hdr.plen field us u8, so checkign if it is bigger than NCI_MAX_PAYLOAD_SIZE does not make any sense. Fix warning reported by Smatch: drivers/nfc/nfcmrvl/i2c.c:52 nfcmrvl_i2c_read() warn: impossible condition '(nci_hdr.plen > 255) => (0-255 > 255)' Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Link: https://lore.kernel.org/r/20210528124200.79655-6-krzysztof.kozlowski@canonical.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/nfcmrvl/i2c.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/nfc/nfcmrvl/i2c.c b/drivers/nfc/nfcmrvl/i2c.c
index bafd9b500b2c..3c9bbee98237 100644
--- a/drivers/nfc/nfcmrvl/i2c.c
+++ b/drivers/nfc/nfcmrvl/i2c.c
@@ -49,11 +49,6 @@ static int nfcmrvl_i2c_read(struct nfcmrvl_i2c_drv_data *drv_data,
return -EBADMSG;
}
- if (nci_hdr.plen > NCI_MAX_PAYLOAD_SIZE) {
- nfc_err(&drv_data->i2c->dev, "invalid packet payload size\n");
- return -EBADMSG;
- }
-
*skb = nci_skb_alloc(drv_data->priv->ndev,
nci_hdr.plen + NCI_CTRL_HDR_SIZE, GFP_KERNEL);
if (!*skb)