[PATCH 1/1] powerpc/perf/24x7: Fix lockdep warning

From: Sukadev Bhattiprolu
Date: Tue Jul 07 2015 - 12:21:10 EST


The sysfs attributes for the 24x7 counters are dynamically allocated.
Initialize the attributes using sysfs_attr_init() to fix following
warning which occurs when CONFIG_DEBUG_LOCK_VMALLOC=y.

[ 0.346249] audit: initializing netlink subsys (disabled)
[ 0.346284] audit: type=2000 audit(1436295254.340:1): initialized
[ 0.346489] BUG: key c0000000efe90198 not in .data!
[ 0.346491] DEBUG_LOCKS_WARN_ON(1)
[ 0.346502] ------------[ cut here ]------------
[ 0.346504] WARNING: at ../kernel/locking/lockdep.c:3002
[ 0.346506] Modules linked in:

Reported-by: Gustavo Luiz Duarte <gustavold@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Sukadev Bhattiprolu <sukadev@xxxxxxxxxxxxxxxxxx>
---
arch/powerpc/perf/hv-24x7.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index ec2eb20..df95629 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -320,6 +320,8 @@ static struct attribute *device_str_attr_create_(char *name, char *str)
if (!attr)
return NULL;

+ sysfs_attr_init(&attr->attr.attr);
+
attr->var = str;
attr->attr.attr.name = name;
attr->attr.attr.mode = 0444;
--
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/