X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=security%2Fselinux%2Fhooks.c;h=c8d699270687e2447976af4b63b51d73749531a6;hb=8bd89ca22010847e85de37b77d9f19f16b1962ad;hp=e276eb468536d0df5b091afa3f08fbf2352a8c81;hpb=f9ee7f60d6f37ae0184812b4c59b3869f875768b;p=mv-sheeva.git diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index e276eb46853..c8d69927068 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -3198,7 +3198,11 @@ static void selinux_cred_free(struct cred *cred) { struct task_security_struct *tsec = cred->security; - BUG_ON((unsigned long) cred->security < PAGE_SIZE); + /* + * cred->security == NULL if security_cred_alloc_blank() or + * security_prepare_creds() returned an error. + */ + BUG_ON(cred->security && (unsigned long) cred->security < PAGE_SIZE); cred->security = (void *) 0x7UL; kfree(tsec); }