From mboxrd@z Thu Jan 1 00:00:00 1970 From: waltfeasel@gmail.com (Walt Feasel) Date: Sat, 26 Nov 2016 03:43:24 -0500 Subject: [PATCH 6/7] security: apparmor: apparmorfs.c Comparison to NULL In-Reply-To: <1480149805-18736-1-git-send-email-waltfeasel@gmail.com> References: <1480149805-18736-1-git-send-email-waltfeasel@gmail.com> Message-ID: <1480149805-18736-7-git-send-email-waltfeasel@gmail.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Make style modifications for: CHECK: Comparison to NULL could be written "!data" Signed-off-by: Walt Feasel --- My first patch of this type checking if this would be correct security/apparmor/apparmorfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index c8142cf..c3fff95 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -102,7 +102,7 @@ static char *aa_simple_write_to_buffer(int op, const char __user *userbuf, /* freed by caller to simple_write_to_buffer */ data = kvmalloc(alloc_size); - if (data == NULL) + if (!data) return ERR_PTR(-ENOMEM); if (copy_from_user(data, userbuf, copy_size)) { -- 2.1.4