Skip to content

Commit 5a48918

Browse files
SinkFindergregkh
authored andcommitted
NFC: fix possible resource leak
commit d8f923c upstream. Put the device to avoid resource leak on path that the polling flag is invalid. Fixes: a831b91 ("NFC: Do not return EBUSY when stopping a poll that's already stopped") Signed-off-by: Pan Bian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e10a1aa commit 5a48918

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/nfc/netlink.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,7 @@ static int nfc_genl_stop_poll(struct sk_buff *skb, struct genl_info *info)
852852

853853
if (!dev->polling) {
854854
device_unlock(&dev->dev);
855+
nfc_put_device(dev);
855856
return -EINVAL;
856857
}
857858

0 commit comments

Comments
 (0)