Commit 60dcb5ff authored by Shang XiaoJing's avatar Shang XiaoJing Committed by David S. Miller

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: c04c674f ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip")
Signed-off-by: default avatarShang XiaoJing <shangxiaojing@huawei.com>
Suggested-by: default avatarPavel Machek <pavel@denx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 614761e1
......@@ -105,6 +105,7 @@ static int s3fwrn5_nci_send(struct nci_dev *ndev, struct sk_buff *skb)
mutex_lock(&info->mutex);
if (s3fwrn5_get_mode(info) != S3FWRN5_MODE_NCI) {
kfree_skb(skb);
mutex_unlock(&info->mutex);
return -EINVAL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment