selinux: cleanup selinux_lsm_getattr()
authorPaul Moore <paul@paul-moore.com>
Fri, 23 Feb 2024 21:26:40 +0000 (16:26 -0500)
committerPaul Moore <paul@paul-moore.com>
Tue, 26 Mar 2024 20:37:45 +0000 (16:37 -0400)
commite6b5ebca41dda07b76b244462995502d9f6eb10b
treef9b492b4320c1caf9cf40ed6105712134f1cec23
parent0142c56682fbf969cc08b1e3f9223384ede29a5f
selinux: cleanup selinux_lsm_getattr()

A number of small changes to selinux_lsm_getattr() to improve the
quality and readability of the code:

* Explicitly set the `value` parameter to NULL in the case where an
  attribute has not been set.
* Rename the `__tsec` variable to `tsec` to better fit the SELinux code.
* Rename `bad` to `err_unlock` to better indicate the jump target drops
  the RCU lock.

Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c