Skip to content

Commit

Permalink
firmware: dmi-sysfs: Don't remove dmi-sysfs "raw" file explicitly
Browse files Browse the repository at this point in the history
Removing the dmi-sysfs module causes the following warning:

  # modprobe -r dmi_sysfs
  WARNING: CPU: 11 PID: 6785 at fs/sysfs/inode.c:325 sysfs_hash_and_remove+0xa9/0xb0()
  sysfs: can not remove 'raw', no directory

This is because putting the entry kobject, e.g., for
"/sys/firmware/dmi/entries/19-0", removes the directory and all its
contents.  By the time dmi_sysfs_entry_release() runs, the "raw" file
inside ".../19-0/" has already been removed.

Therefore, we don't need to remove the "raw" bin file at all in
dmi_sysfs_entry_release().

Signed-off-by: Bjorn Helgaas <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
bjorn-helgaas authored and gregkh committed Dec 9, 2013
1 parent 68aeeaa commit a61aca2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/firmware/dmi-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ static const struct bin_attribute dmi_entry_raw_attr = {
static void dmi_sysfs_entry_release(struct kobject *kobj)
{
struct dmi_sysfs_entry *entry = to_entry(kobj);
sysfs_remove_bin_file(&entry->kobj, &dmi_entry_raw_attr);

spin_lock(&entry_list_lock);
list_del(&entry->list);
spin_unlock(&entry_list_lock);
Expand Down

0 comments on commit a61aca2

Please sign in to comment.