X-Git-Url: https://bbs.cooldavid.org/git/?a=blobdiff_plain;f=security%2Fapparmor%2Flsm.c;h=b7106f192b75d5d382e806d303a9b2f6bb879747;hb=24912420e923d56461b400d83f250a31bed8a964;hp=cf1de4462ccd3fb297f48bf351dd3494804f22c1;hpb=dd4025bdb6c731b6cd23f97797ef6d8dbfeb9e9d;p=net-next-2.6.git diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index cf1de4462cc..b7106f192b7 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -922,7 +922,7 @@ static int __init apparmor_init(void) error = register_security(&apparmor_ops); if (error) { AA_ERROR("Unable to register AppArmor\n"); - goto register_security_out; + goto set_init_cxt_out; } /* Report that AppArmor successfully initialized */ @@ -936,6 +936,9 @@ 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(); @@ -944,7 +947,6 @@ alloc_out: apparmor_enabled = 0; return error; - } security_initcall(apparmor_init);