mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>
Subject: [PATCH] perf/x86/amd/uncore: fix ifnullfree.cocci warnings
Date: Thu, 12 Jan 2017 21:12:58 +0800	[thread overview]
Message-ID: <20170112131258.GA1861@xian.lkp.intel.com> (raw)
In-Reply-To: <11f5b2f7a63c0123cd2f9ba9cb4693c6feca1205.1484148262.git.Janakarajan.Natarajan@amd.com>

arch/x86/events/amd/uncore.c:365: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: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -361,8 +361,7 @@ static void amd_uncore_cpu_up_nb_free(un
 	struct amd_uncore *uncore_nb;
 
 	uncore_nb = *per_cpu_ptr(amd_uncore_nb, cpu);
-	if (uncore_nb)
-		kfree(uncore_nb);
+	kfree(uncore_nb);
 	*per_cpu_ptr(amd_uncore_nb, cpu) = NULL;
 }
 

  parent reply	other threads:[~2017-01-12 13:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11 16:02 [PATCH 0/3] perf/x86/amd/uncore: Update AMD uncore driver Janakarajan Natarajan
2017-01-11 16:02 ` [PATCH 1/3] perf/x86/amd/uncore: Update AMD uncore to rename L2 to LLC Janakarajan Natarajan
2017-01-11 16:02 ` [PATCH 2/3] perf/x86/amd/uncore: Dynamically allocate uncore counters Janakarajan Natarajan
2017-01-12  9:20   ` Peter Zijlstra
2017-01-13  0:48     ` Natarajan, Janakarajan
2017-01-13  8:58       ` Peter Zijlstra
2017-01-12 13:12   ` kbuild test robot
2017-01-12 13:12   ` kbuild test robot [this message]
2017-01-11 16:02 ` [PATCH 3/3] perf/x86/amd/uncore: Update sysfs attributes for Family17h processors Janakarajan Natarajan

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=20170112131258.GA1861@xian.lkp.intel.com \
    --to=lkp@intel.com \
    --cc=Janakarajan.Natarajan@amd.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=suravee.suthikulpanit@amd.com \
    /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

Powered by JetHome