Skip to contentSkip to conversation

sfc: initialize dynamic sysfs attributes for lockdep

PATCH Applied Michal Schmidt 3 participants 3 messages Jul 19, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sfc: initialize dynamic sysfs attributes for lockdep

Dynamically allocated sysfs attributes must be initialized using sysfs_attr_init(), otherwise lockdep complains:

BUG: key <address> not in .data!
---
 drivers/net/ethernet/sfc/mcdi_mon.c |    1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/sfc/mcdi_mon.c +1 -0
index fb7f65b..1d552f0 100644
@@ -222,6 +222,7 @@ efx_mcdi_mon_add_attr(struct efx_nic *efx, const char *name,
 	attr->index = index;
 	attr->type = type;
 	attr->limit_value = limit_value;
+	sysfs_attr_init(&attr->dev_attr.attr);
 	attr->dev_attr.attr.name = attr->name;
 	attr->dev_attr.attr.mode = S_IRUGO;
 	attr->dev_attr.show = reader;
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Michal Schmidt

Dynamically allocated sysfs attributes must be initialized using sysfs_attr_init(), otherwise lockdep complains:

BUG: key <address> not in .data!
Quoted 16 lines
---
 drivers/net/ethernet/sfc/mcdi_mon.c |    1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/sfc/mcdi_mon.c +1 -0
index fb7f65b..1d552f0 100644
@@ -222,6 +222,7 @@ efx_mcdi_mon_add_attr(struct efx_nic *efx, const char *name,
 	attr->index = index;
 	attr->type = type;
 	attr->limit_value = limit_value;
+	sysfs_attr_init(&attr->dev_attr.attr);
 	attr->dev_attr.attr.name = attr->name;
 	attr->dev_attr.attr.mode = S_IRUGO;
 	attr->dev_attr.show = reader;
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.