diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index d019d6ac6ad0..fd55a4a04d6d 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -440,6 +440,8 @@ struct kernfs_node *sysfs_break_active_protection(struct kobject *kobj, kn = kernfs_find_and_get(kobj->sd, attr->name); if (kn) kernfs_break_active_protection(kn); + else + kobject_put(kobj); return kn; } EXPORT_SYMBOL_GPL(sysfs_break_active_protection);