diff mbox

apparmor: fix boolreturn.cocci warnings

Message ID 20170116235757.GA82084@cairo.lkp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fengguang Wu Jan. 16, 2017, 11:58 p.m. UTC
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>
---

 lib.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/security/apparmor/lib.c
+++ b/security/apparmor/lib.c
@@ -129,13 +129,13 @@  bool aa_policy_init(struct aa_policy *po
 	} else
 		policy->hname = kstrdup(name, GFP_KERNEL);
 	if (!policy->hname)
-		return 0;
+		return false;
 	/* base.name is a substring of fqname */
 	policy->name = (char *)hname_tail(policy->hname);
 	INIT_LIST_HEAD(&policy->list);
 	INIT_LIST_HEAD(&policy->profiles);
 
-	return 1;
+	return true;
 }
 
 /**