]> git.baikalelectronics.ru Git - kernel.git/commit
nfc: Fix potential resource leaks
authorMiaoqian Lin <linmq006@gmail.com>
Fri, 23 Dec 2022 07:37:18 +0000 (11:37 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:57 +0000 (11:41 +0100)
commitfc764072bca1d7431103b443fb53bf8779130ffc
tree5c99848c765a6229af1033a78232b8b74efb1415
parent642cc2d439dd0d107962ec6f13cecea0f61f1c44
nfc: Fix potential resource leaks

[ Upstream commit 6c5d22f47d82f2c03ffd2dcbca37273a384ba5e9 ]

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: 93b728042fb4 ("NFC: netlink: SE API implementation")
Fixes: 37e1a7ab7447 ("nfc: netlink: Add capability to reply to vendor_cmd with data")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/nfc/netlink.c