[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170112131258.GA1861@xian.lkp.intel.com>
Date: Thu, 12 Jan 2017 21:12:58 +0800
From: kbuild test robot <lkp@...el.com>
To: Janakarajan Natarajan <Janakarajan.Natarajan@....com>
Cc: kbuild-all@...org, linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
Janakarajan Natarajan <Janakarajan.Natarajan@....com>
Subject: [PATCH] perf/x86/amd/uncore: fix ifnullfree.cocci warnings
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@....com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.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;
}
Powered by blists - more mailing lists