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>
This commit is contained in:
Christian Göttsche 2022-01-25 15:14:18 +01:00 коммит произвёл Paul Moore
Родитель 73073d956a
Коммит b084e189b0
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -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;
}