|
@@ -41,7 +41,7 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,
|
|
|
|
|
|
if (grp->attrs) {
|
|
if (grp->attrs) {
|
|
for (i = 0, attr = grp->attrs; *attr && !error; i++, attr++) {
|
|
for (i = 0, attr = grp->attrs; *attr && !error; i++, attr++) {
|
|
- umode_t mode = 0;
|
|
|
|
|
|
+ umode_t mode = (*attr)->mode;
|
|
|
|
|
|
/*
|
|
/*
|
|
* In update mode, we're changing the permissions or
|
|
* In update mode, we're changing the permissions or
|
|
@@ -56,8 +56,7 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
error = sysfs_add_file_mode_ns(parent, *attr, false,
|
|
error = sysfs_add_file_mode_ns(parent, *attr, false,
|
|
- (*attr)->mode | mode,
|
|
|
|
- NULL);
|
|
|
|
|
|
+ mode, NULL);
|
|
if (unlikely(error))
|
|
if (unlikely(error))
|
|
break;
|
|
break;
|
|
}
|
|
}
|