All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] coccinelle: ifnullfree: fix ifnullfree.cocci warnings
Date: Sat, 03 Oct 2020 03:44:04 +0800	[thread overview]
Message-ID: <20201002194404.GA528@8cbb73b479b5> (raw)
In-Reply-To: <202010030349.ukMxko0g-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1738 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Dave Young <dyoung@redhat.com>
CC: Baoquan He <bhe@redhat.com>
CC: Vivek Goyal <vgoyal@redhat.com>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: kexec(a)lists.infradead.org
CC: linux-kernel(a)vger.kernel.org
CC: linux-fsdevel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

fs/proc/vmcore.c:1507:2-7: WARNING: NULL check before some freeing functions is not needed.
fs/proc/vmcore.c:1510:2-7: WARNING: NULL check before some freeing functions is not needed.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Fixes: 5e0c074e5b4b ("coccinelle: ifnullfree: add vfree(), kvfree*() functions")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10
head:   44d8870f21529cfa8f50b503b5d949c6d46e6fc1
commit: 5e0c074e5b4be02d57d1b60abc3391afe7edd088 [4/10] coccinelle: ifnullfree: add vfree(), kvfree*() functions
:::::: branch date: 24 hours ago
:::::: commit date: 4 weeks ago

Please take the patch only if it's a positive warning. Thanks!

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

--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -1503,11 +1503,9 @@ int vmcore_add_device_dump(struct vmcore
 	return 0;
 
 out_err:
-	if (buf)
-		vfree(buf);
+	vfree(buf);
 
-	if (dump)
-		vfree(dump);
+	vfree(dump);
 
 	return ret;
 }

  parent reply	other threads:[~2020-10-02 19:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 19:44 [jlawall:for-5.10 4/10] drivers/lightnvm/pblk-gc.c:27:2-7: WARNING: NULL check before some freeing functions is not needed kernel test robot
2020-10-02 19:44 ` [PATCH] coccinelle: ifnullfree: fix ifnullfree.cocci warnings kernel test robot
2020-10-02 19:44 ` kernel test robot
2020-10-02 19:44 ` kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-12-11  4:11 drivers/scsi/megaraid/megaraid_sas_fusion.c:3921:3-8: WARNING: NULL check before some freeing functions is not needed kernel test robot
2020-12-11  4:11 ` [PATCH] coccinelle: ifnullfree: fix ifnullfree.cocci warnings kernel test robot
2020-10-26 17:14 drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c:81:2-8: WARNING: NULL check before some freeing functions is not needed kernel test robot
2020-10-26 17:14 ` [PATCH] coccinelle: ifnullfree: fix ifnullfree.cocci warnings kernel test robot
2020-09-02 19:40 [jlawall:for-5.10 5/5] drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c:81:2-8: WARNING: NULL check before some freeing functions is not needed kernel test robot
2020-09-02 19:41 ` [PATCH] coccinelle: ifnullfree: fix ifnullfree.cocci warnings kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201002194404.GA528@8cbb73b479b5 \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.