提交 f90fc547 编写于 作者: A Anand Jain 提交者: David Sterba

Btrfs: Check if kobject is initialized before put

Signed-off-by: NAnand Jain <anand.jain@oracle.com>
Tested-by: NDavid Sterba <dsterba@suse.cz>
Signed-off-by: NDavid Sterba <dsterba@suse.cz>
上级 24199d20
......@@ -523,9 +523,11 @@ static void __btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs)
fs_devs->device_dir_kobj = NULL;
}
kobject_del(&fs_devs->super_kobj);
kobject_put(&fs_devs->super_kobj);
wait_for_completion(&fs_devs->kobj_unregister);
if (fs_devs->super_kobj.state_initialized) {
kobject_del(&fs_devs->super_kobj);
kobject_put(&fs_devs->super_kobj);
wait_for_completion(&fs_devs->kobj_unregister);
}
}
/* when fs_devs is NULL it will remove all fsid kobject */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册