summaryrefslogtreecommitdiff
path: root/net/nfc
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-20 10:00:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-20 10:00:30 +0100
commit35eaa42c4a1017c08d0572008db375becb621744 (patch)
tree8185b6d18acfc63285e3132c9039c7d6c9a90527 /net/nfc
parent4b95391c8ef0f270ed58234597aef58976abe01c (diff)
parenta7904a538933c525096ca2ccde1e60d0ee62c08e (diff)
Merge 5.16-rc6 into tty-next
We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/netlink.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 334f63c9529e..f184b0db79d4 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -636,8 +636,10 @@ static int nfc_genl_dump_devices_done(struct netlink_callback *cb)
{
struct class_dev_iter *iter = (struct class_dev_iter *) cb->args[0];
- nfc_device_iter_exit(iter);
- kfree(iter);
+ if (iter) {
+ nfc_device_iter_exit(iter);
+ kfree(iter);
+ }
return 0;
}
@@ -1392,8 +1394,10 @@ static int nfc_genl_dump_ses_done(struct netlink_callback *cb)
{
struct class_dev_iter *iter = (struct class_dev_iter *) cb->args[0];
- nfc_device_iter_exit(iter);
- kfree(iter);
+ if (iter) {
+ nfc_device_iter_exit(iter);
+ kfree(iter);
+ }
return 0;
}