Commit 5848d1cc authored by Shang XiaoJing's avatar Shang XiaoJing Committed by openeuler-sync-bot
Browse files

nfc: s3fwrn5: Fix potential memory leak in s3fwrn5_nci_send()

stable inclusion
from stable-v5.10.154
commit 0acfcd2aed4f7eaf086218414c6b7a197c9873f3
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I64YCB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0acfcd2aed4f7eaf086218414c6b7a197c9873f3



--------------------------------

[ Upstream commit 3a146b7e ]

s3fwrn5_nci_send() will call s3fwrn5_i2c_write() or s3fwrn82_uart_write(),
and free the skb if write() failed. However, even if the write() run
succeeds, the skb will not be freed in write(). As the result, the skb
will memleak. s3fwrn5_nci_send() should also free the skb when write()
succeeds.

Fixes: c04c674f ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip")
Signed-off-by: default avatarShang XiaoJing <shangxiaojing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLipeng Sang <sanglipeng1@jd.com>
(cherry picked from commit 53b15821)
parent 2740b25f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment