]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
audit: move calcs after alloc and check when logging set loginuid
authorRichard Guy Briggs <rgb@redhat.com>
Tue, 28 Jun 2016 16:06:58 +0000 (12:06 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 May 2018 06:48:49 +0000 (08:48 +0200)
commit9bb698bedebf437ae3de8bae8e1aa8bca02664da
tree618cd752f929f4fc253179ce3cacfb533baa4506
parentbea8a671cee74232bbeef3980354cb9b305f6a9f
audit: move calcs after alloc and check when logging set loginuid

commit 76a658c20efd541a62838d9ff68ce94170d7a549 upstream.

Move the calculations of values after the allocation in case the
allocation fails.  This avoids wasting effort in the rare case that it
fails, but more importantly saves us extra logic to release the tty
ref.

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/auditsc.c