apparmor: fix boolreturn.cocci warnings
authorkbuild test robot <fengguang.wu@intel.com>
Thu, 6 Apr 2017 13:55:19 +0000 (06:55 -0700)
committerJames Morris <james.l.morris@oracle.com>
Thu, 6 Apr 2017 22:58:35 +0000 (08:58 +1000)
security/apparmor/lib.c:132:9-10: WARNING: return of 0/1 in function 'aa_policy_init' with return type bool

 Return statements in functions returning bool should use
 true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
security/apparmor/lib.c

index 66475bda6f72212c330e7c6f8febfc930beb4e74..32cafc12593ef8f52d3164c46a4c90fe6b9a1743 100644 (file)
@@ -180,13 +180,13 @@ bool aa_policy_init(struct aa_policy *policy, const char *prefix,
        } else
                policy->hname = kstrdup(name, gfp);
        if (!policy->hname)
-               return 0;
+               return false;
        /* base.name is a substring of fqname */
        policy->name = basename(policy->hname);
        INIT_LIST_HEAD(&policy->list);
        INIT_LIST_HEAD(&policy->profiles);
 
-       return 1;
+       return true;
 }
 
 /**