summaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2022-01-25 15:14:18 +0100
committerPaul Moore <paul@paul-moore.com>2022-01-26 15:57:39 -0500
commitb084e189b01a7614d3098aca4f2381a759460d88 (patch)
tree1c7c71d34f5d54335d3ec1e27ee3b16443e6cb94 /security/selinux
parent73073d956a2073554b99d621a7a7ec9437055044 (diff)
downloadlinux-b084e189b01a7614d3098aca4f2381a759460d88.tar.gz
linux-b084e189b01a7614d3098aca4f2381a759460d88.tar.bz2
linux-b084e189b01a7614d3098aca4f2381a759460d88.zip
selinux: simplify cred_init_security
The parameter of selinux_cred() is declared const, so an explicit cast dropping the const qualifier is not necessary. Without the cast the local variable cred serves no purpose. Reported by clang [-Wcast-qual] Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/hooks.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index a0243bae8423..eae7dbd62df1 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -211,10 +211,9 @@ static int selinux_lsm_notifier_avc_callback(u32 event)
*/
static void cred_init_security(void)
{
- struct cred *cred = (struct cred *) current->real_cred;
struct task_security_struct *tsec;
- tsec = selinux_cred(cred);
+ tsec = selinux_cred(current->real_cred);
tsec->osid = tsec->sid = SECINITSID_KERNEL;
}