Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sysfs: fix attribute_group bin file path on removal

Cody Schafer already fixed binary file creation for attribute groups, see [1].
This patch makes the appropriate changes for binary file removal
of attribute groups.
[1]: http://lkml.org/lkml/2014/2/27/832

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Robert ABEL and committed by
Greg Kroah-Hartman
9f70a401 78e1da62

+5 -5
+5 -5
fs/sysfs/group.c
··· 18 18 #include "sysfs.h" 19 19 20 20 21 - static void remove_files(struct kernfs_node *parent, struct kobject *kobj, 21 + static void remove_files(struct kernfs_node *parent, 22 22 const struct attribute_group *grp) 23 23 { 24 24 struct attribute *const *attr; ··· 29 29 kernfs_remove_by_name(parent, (*attr)->name); 30 30 if (grp->bin_attrs) 31 31 for (bin_attr = grp->bin_attrs; *bin_attr; bin_attr++) 32 - sysfs_remove_bin_file(kobj, *bin_attr); 32 + kernfs_remove_by_name(parent, (*bin_attr)->attr.name); 33 33 } 34 34 35 35 static int create_files(struct kernfs_node *parent, struct kobject *kobj, ··· 62 62 break; 63 63 } 64 64 if (error) { 65 - remove_files(parent, kobj, grp); 65 + remove_files(parent, grp); 66 66 goto exit; 67 67 } 68 68 } ··· 79 79 break; 80 80 } 81 81 if (error) 82 - remove_files(parent, kobj, grp); 82 + remove_files(parent, grp); 83 83 } 84 84 exit: 85 85 return error; ··· 224 224 kernfs_get(kn); 225 225 } 226 226 227 - remove_files(kn, kobj, grp); 227 + remove_files(kn, grp); 228 228 if (grp->name) 229 229 kernfs_remove(kn); 230 230