Skip to content

Commit

Permalink
apparmor: Force type-casting of current->real_cred
Browse files Browse the repository at this point in the history
This patch fixes the sparse warning:
warning: cast removes address space '<asn:4>' of expression.

Signed-off-by: Bharath Vedartham <linux.bhar@gmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
  • Loading branch information
Bharath Vedartham authored and John Johansen committed Jun 20, 2019
1 parent 058c4f3 commit bf1d2ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/apparmor/lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)));

Expand Down

0 comments on commit bf1d2ee

Please sign in to comment.