Skip to content

Commit

Permalink
hwmon: (applesmc) Properly initialize lockdep attributes
Browse files Browse the repository at this point in the history
The switch to dynamically allocated sysfs attributes left the
internal lockdep members uninitialized, causing a formal bug.
This patch adds sysfs_attr_init() to the node creation function,
remedying the problem.

Reported-and-tested-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
  • Loading branch information
rydberg authored and Guenter Roeck committed Jan 23, 2011
1 parent 1bae4ce commit 9d1f8a4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/hwmon/applesmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,7 @@ static int applesmc_create_nodes(struct applesmc_node_group *groups, int num)
node->sda.dev_attr.show = grp->show;
node->sda.dev_attr.store = grp->store;
attr = &node->sda.dev_attr.attr;
sysfs_attr_init(attr);
attr->name = node->name;
attr->mode = S_IRUGO | (grp->store ? S_IWUSR : 0);
ret = sysfs_create_file(&pdev->dev.kobj, attr);
Expand Down

0 comments on commit 9d1f8a4

Please sign in to comment.