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: Fri, 11 Dec 2020 12:11:59 +0800	[thread overview]
Message-ID: <20201211041158.GA89621@c9287d783486> (raw)
In-Reply-To: <202012111228.Vj1btHjx-lkp@intel.com>

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Kashyap Desai <kashyap.desai@broadcom.com>
CC: Sumit Saxena <sumit.saxena@broadcom.com>
CC: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: megaraidlinux.pdl(a)broadcom.com
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/scsi/megaraid/megaraid_sas_fusion.c:3921:3-8: 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>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   33dc9614dc208291d0c4bcdeb5d30d481dcd2c4c
commit: 5e0c074e5b4be02d57d1b60abc3391afe7edd088 coccinelle: ifnullfree: add vfree(), kvfree*() functions
:::::: branch date: 3 hours ago
:::::: commit date: 3 months ago

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

 megaraid_sas_fusion.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3917,8 +3917,7 @@ megasas_free_host_crash_buffer(struct me
 {
 	unsigned int i;
 	for (i = 0; i < instance->drv_buf_alloc; i++) {
-		if (instance->crash_buf[i])
-			vfree(instance->crash_buf[i]);
+		vfree(instance->crash_buf[i]);
 	}
 	instance->drv_buf_index = 0;
 	instance->drv_buf_alloc = 0;

  reply	other threads:[~2020-12-11  4:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-10-26 17:14 drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c:81:2-8: " kernel test robot
2020-10-26 17:14 ` [PATCH] coccinelle: ifnullfree: fix ifnullfree.cocci warnings kernel test robot
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
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=20201211041158.GA89621@c9287d783486 \
    --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.