Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f90fc547 authored by Anand Jain's avatar Anand Jain Committed by David Sterba
Browse files

Btrfs: Check if kobject is initialized before put

parent 24199d20
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -523,10 +523,12 @@ static void __btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs)
		fs_devs->device_dir_kobj = NULL;
		fs_devs->device_dir_kobj = NULL;
	}
	}


	if (fs_devs->super_kobj.state_initialized) {
		kobject_del(&fs_devs->super_kobj);
		kobject_del(&fs_devs->super_kobj);
		kobject_put(&fs_devs->super_kobj);
		kobject_put(&fs_devs->super_kobj);
		wait_for_completion(&fs_devs->kobj_unregister);
		wait_for_completion(&fs_devs->kobj_unregister);
	}
	}
}


/* when fs_devs is NULL it will remove all fsid kobject */
/* when fs_devs is NULL it will remove all fsid kobject */
void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs)
void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs)