audit: fix a net reference leak in audit_send_reply()
authorPaul Moore <paul@paul-moore.com>
Mon, 20 Apr 2020 14:09:29 +0000 (10:09 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:30:59 +0000 (09:30 +0200)
commit189ca174b87ddaeff40932372e4015432e4886b3
tree440971c218e092537fb23511e0beaa7034239037
parent6315839f14b97ea0ad2dd08af7984df0058cf011
audit: fix a net reference leak in audit_send_reply()

[ Upstream commit a48b284b403a4a073d8beb72d2bb33e54df67fb6 ]

If audit_send_reply() fails when trying to create a new thread to
send the reply it also fails to cleanup properly, leaking a reference
to a net structure.  This patch fixes the error path and makes a
handful of other cleanups that came up while fixing the code.

Reported-by: teroincn@gmail.com
Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/audit.c