lib/kobject.c : Remove redundant check in create_dir
create_dir is a static function used only in kobject_add_internal. There's no need to do check here, for kobject_add_internal will reject kobject with invalid name. Signed-off-by: Yan Hong <clouds.yan@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9169c01236
commit
6b9606106b
@ -47,13 +47,11 @@ static int populate_dir(struct kobject *kobj)
|
|||||||
static int create_dir(struct kobject *kobj)
|
static int create_dir(struct kobject *kobj)
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
if (kobject_name(kobj)) {
|
error = sysfs_create_dir(kobj);
|
||||||
error = sysfs_create_dir(kobj);
|
if (!error) {
|
||||||
if (!error) {
|
error = populate_dir(kobj);
|
||||||
error = populate_dir(kobj);
|
if (error)
|
||||||
if (error)
|
sysfs_remove_dir(kobj);
|
||||||
sysfs_remove_dir(kobj);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user