Commit d97c1a98 authored by Miaoqian Lin's avatar Miaoqian Lin Committed by zhaoxiaoqiang11
Browse files

nfc: Fix potential resource leaks

stable inclusion
from stable-v5.10.163
commit e0f5c962c066e769c187f037fedc883f8abd4e82
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7PJ9N

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



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

[ Upstream commit df49908f ]

nfc_get_device() take reference for the device, add missing
nfc_put_device() to release it when not need anymore.
Also fix the style warnning by use error EOPNOTSUPP instead of
ENOTSUPP.

Fixes: 5ce3f32b ("NFC: netlink: SE API implementation")
Fixes: 29e76924 ("nfc: netlink: Add capability to reply to vendor_cmd with data")
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
parent d5b5379e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment