]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
NFC: nxp-nci: Don't issue a zero length i2c_master_read()
authorMichael Walle <michael@walle.cc>
Mon, 27 Jun 2022 17:06:42 +0000 (19:06 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:54:18 +0000 (10:54 +0200)
commit56963881bfc11dd13946d999315019cd4fea4746
treeac735d07b9a3b6ba7dd11605f6a6b23b45ae214b
parent79332596ef1a3a25d10cdd334e68c6c57e0f3c96
NFC: nxp-nci: Don't issue a zero length i2c_master_read()

BugLink: https://bugs.launchpad.net/bugs/1986728
commit eddd95b9423946aaacb55cac6a9b2cea8ab944fc upstream.

There are packets which doesn't have a payload. In that case, the second
i2c_master_read() will have a zero length. But because the NFC
controller doesn't have any data left, it will NACK the I2C read and
-ENXIO will be returned. In case there is no payload, just skip the
second i2c master read.

Fixes: 6be88670fc59 ("NFC: nxp-nci_i2c: Add I2C support to NXP NCI driver")
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/nfc/nxp-nci/i2c.c