From: Krzysztof Kozlowski Date: Fri, 28 May 2021 12:41:54 +0000 (-0400) Subject: nfc: mrvl: skip impossible NCI_MAX_PAYLOAD_SIZE check X-Git-Tag: v5.15~843^2~436 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41a6bf50ee04a604f84ba8989055781d68061ed6;p=platform%2Fkernel%2Flinux-starfive.git 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 Link: https://lore.kernel.org/r/20210528124200.79655-6-krzysztof.kozlowski@canonical.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/nfc/nfcmrvl/i2c.c b/drivers/nfc/nfcmrvl/i2c.c index bafd9b5..3c9bbee 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)