mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: Karol Herbst <nouveau@karolherbst.de>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
	Ben Skeggs <bskeggs@redhat.com>,
	Martin Peres <martin.peres@free.fr>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/nouveau/iccsense: fix ifnullfree.cocci warnings
Date: Wed, 13 Apr 2016 15:07:42 +0800	[thread overview]
Message-ID: <20160413070742.GA9311@lkp-nex05> (raw)
In-Reply-To: <201604131531.CJokPLHc%fengguang.wu@intel.com>

drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c:133:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.

 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

CC: Karol Herbst <nouveau@karolherbst.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
@@ -129,8 +129,7 @@ nvkm_iccsense_dtor(struct nvkm_subdev *s
 {
 	struct nvkm_iccsense *iccsense = nvkm_iccsense(subdev);
 
-	if (iccsense->rails)
-		kfree(iccsense->rails);
+	kfree(iccsense->rails);
 
 	return iccsense;
 }

  reply	other threads:[~2016-04-13  7:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13  7:07 drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c:133:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values kbuild test robot
2016-04-13  7:07 ` kbuild test robot [this message]
2016-04-13  7:55   ` [PATCH] drm/nouveau/iccsense: fix ifnullfree.cocci warnings Martin Peres
2016-04-13 10:08     ` Karol Herbst

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=20160413070742.GA9311@lkp-nex05 \
    --to=fengguang.wu@intel.com \
    --cc=airlied@linux.ie \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.peres@free.fr \
    --cc=nouveau@karolherbst.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®