Skip to content

Commit

Permalink
Should be umode_t
Browse files Browse the repository at this point in the history
  • Loading branch information
madaidan committed Apr 12, 2020
1 parent 9208097 commit 6cf4e76
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/sysfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int sysfs_restrict = IS_ENABLED(CONFIG_SECURITY_SYSFS_RESTRICT);
int sysfs_create_dir_ns(struct kobject *kobj, const void *ns)
{
struct kernfs_node *parent, *kn;
const char *mode;
umode_t *mode = S_IRWXU;
kuid_t uid;
kgid_t gid;

Expand All @@ -59,9 +59,7 @@ int sysfs_create_dir_ns(struct kobject *kobj, const void *ns)

kobject_get_ownership(kobj, &uid, &gid);

if (sysfs_restrict)
mode = S_IRWXU;
else
if (!sysfs_restrict)
mode = S_IRWXU | S_IRUGO | S_IXUGO;

kn = kernfs_create_dir_ns(parent, kobject_name(kobj),
Expand Down

0 comments on commit 6cf4e76

Please sign in to comment.