From bf1d2ee7bc6215dd92427625a4c707227457a5db Mon Sep 17 00:00:00 2001 From: Bharath Vedartham Date: Tue, 23 Apr 2019 22:23:00 +0530 Subject: [PATCH] apparmor: Force type-casting of current->real_cred This patch fixes the sparse warning: warning: cast removes address space '' of expression. Signed-off-by: Bharath Vedartham Signed-off-by: John Johansen --- security/apparmor/lsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 502846789965..8f7ffc51ad86 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -1576,7 +1576,7 @@ static int param_set_mode(const char *val, const struct kernel_param *kp) */ static int __init set_init_ctx(void) { - struct cred *cred = (struct cred *)current->real_cred; + struct cred *cred = (__force struct cred *)current->real_cred; set_cred_label(cred, aa_get_label(ns_unconfined(root_ns))); -- 2.45.2