]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfc: fix potential NULL pointer deref in nfc_genl_dump_ses_done
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Thu, 9 Dec 2021 08:13:07 +0000 (09:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Dec 2021 13:48:59 +0000 (14:48 +0100)
commit48fcd08fdbe05e35b650a252ec2a2d96057a1c7a
tree2349a1ff40346282ca48451f3fc1854d3629f93d
parent1a295fea90e1acbe80c6d4940f5ff856edcd6bec
nfc: fix potential NULL pointer deref in nfc_genl_dump_ses_done

commit 4cd8371a234d051f9c9557fcbb1f8c523b1c0d10 upstream.

The done() netlink callback nfc_genl_dump_ses_done() should check if
received argument is non-NULL, because its allocation could fail earlier
in dumpit() (nfc_genl_dump_ses()).

Fixes: ac22ac466a65 ("NFC: Add a GET_SE netlink API")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20211209081307.57337-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/nfc/netlink.c