]> git.baikalelectronics.ru Git - kernel.git/commit
nfc: s3fwrn5: Fix potential memory leak in s3fwrn5_nci_send()
authorShang XiaoJing <shangxiaojing@huawei.com>
Thu, 17 Nov 2022 11:37:14 +0000 (19:37 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Nov 2022 08:31:53 +0000 (08:31 +0000)
commitbdd075b49bb4a62382a19b27b49a550aea236ca1
tree44ea79920a9de643f446c47a72e3bd9883c8ac93
parentd3d42e14041a8183b2031545658fe8ed9785d288
nfc: s3fwrn5: Fix potential memory leak in s3fwrn5_nci_send()

s3fwrn5_nci_send() won't free the skb when it failed for the check
before s3fwrn5_write(). As the result, the skb will memleak. Free the
skb when the check failed.

Fixes: 0e3b45f0771d ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Suggested-by: Pavel Machek <pavel@denx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/nfc/s3fwrn5/core.c