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: Thu, 03 Sep 2020 03:41:01 +0800	[thread overview]
Message-ID: <20200902194101.GA94484@ef6594e38abe> (raw)
In-Reply-To: <202009030342.3rHLGgR4%lkp@intel.com>

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

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Lucas Stach <l.stach@pengutronix.de>
CC: Russell King <linux+etnaviv@armlinux.org.uk>
CC: Christian Gmeiner <christian.gmeiner@gmail.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: etnaviv(a)lists.freedesktop.org
CC: dri-devel(a)lists.freedesktop.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c:81:2-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: 5f80f474a2c3 ("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:   5f80f474a2c330a8e8e30e844f1a06811f082963
commit: 5f80f474a2c330a8e8e30e844f1a06811f082963 [5/5] coccinelle: ifnullfree: add vfree(), kvfree*() functions
:::::: branch date: 13 hours ago
:::::: commit date: 13 hours ago

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

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

--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
@@ -77,8 +77,7 @@ static void etnaviv_gem_prime_release(st
 	/* Don't drop the pages for imported dmabuf, as they are not
 	 * ours, just free the array we allocated:
 	 */
-	if (etnaviv_obj->pages)
-		kvfree(etnaviv_obj->pages);
+	kvfree(etnaviv_obj->pages);
 
 	drm_prime_gem_destroy(&etnaviv_obj->base, etnaviv_obj->sgt);
 }

  reply	other threads:[~2020-09-02 19:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` kernel test robot [this message]
2020-10-02 19:44 [jlawall:for-5.10 4/10] drivers/lightnvm/pblk-gc.c:27:2-7: " 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-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-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

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=20200902194101.GA94484@ef6594e38abe \
    --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.