summaryrefslogtreecommitdiffstats
path: root/security/apparmor/lsm.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2013-02-21 13:25:44 -0800
committerJohn Johansen <john.johansen@canonical.com>2013-04-28 00:39:35 -0700
commit53fe8b9961716033571d9799005bfdbbafa5162c (patch)
tree65e4a560f30d7b929059cd5cf9814b700e791a52 /security/apparmor/lsm.c
parent41d1b3e868c263e8b43dd5903a70633e05ae58a6 (diff)
downloadop-kernel-dev-53fe8b9961716033571d9799005bfdbbafa5162c.zip
op-kernel-dev-53fe8b9961716033571d9799005bfdbbafa5162c.tar.gz
apparmor: fix sparse warnings
Fix a couple of warning reported by sparse Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/lsm.c')
-rw-r--r--security/apparmor/lsm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index ed7e3aa..10843aa 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -909,8 +909,11 @@ static int __init apparmor_init(void)
error = register_security(&apparmor_ops);
if (error) {
+ struct cred *cred = (struct cred *)current->real_cred;
+ aa_free_task_context(cred->security);
+ cred->security = NULL;
AA_ERROR("Unable to register AppArmor\n");
- goto set_init_cxt_out;
+ goto register_security_out;
}
/* Report that AppArmor successfully initialized */
@@ -924,9 +927,6 @@ static int __init apparmor_init(void)
return error;
-set_init_cxt_out:
- aa_free_task_context(current->real_cred->security);
-
register_security_out:
aa_free_root_ns();
OpenPOWER on IntegriCloud