diff options
Diffstat (limited to 'fs/sysfs/group.c')
-rw-r--r-- | fs/sysfs/group.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c index 4bd997340830..065689ddb4cb 100644 --- a/fs/sysfs/group.c +++ b/fs/sysfs/group.c @@ -101,9 +101,12 @@ static int internal_create_group(struct kobject *kobj, int update, return -EINVAL; } if (grp->name) { - error = sysfs_create_subdir(kobj, grp->name, &sd); - if (error) - return error; + sd = kernfs_create_dir(kobj->sd, grp->name, kobj); + if (IS_ERR(sd)) { + if (PTR_ERR(sd) == -EEXIST) + sysfs_warn_dup(kobj->sd, grp->name); + return PTR_ERR(sd); + } } else sd = kobj->sd; sysfs_get(sd); |