aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r--fs/sysfs/inode.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 617d10cea07d..7b9a8f132d5a 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -277,12 +277,16 @@ int sysfs_hash_and_remove(struct dentry * dir, const char * name)
277 if (!strcmp(sd->s_name, name)) { 277 if (!strcmp(sd->s_name, name)) {
278 list_del_init(&sd->s_sibling); 278 list_del_init(&sd->s_sibling);
279 sysfs_drop_dentry(sd, dir); 279 sysfs_drop_dentry(sd, dir);
280 sysfs_put(sd);
281 found = 1; 280 found = 1;
282 break; 281 break;
283 } 282 }
284 } 283 }
285 mutex_unlock(&dir->d_inode->i_mutex); 284 mutex_unlock(&dir->d_inode->i_mutex);
286 285
287 return found ? 0 : -ENOENT; 286 if (!found)
287 return -ENOENT;
288
289 sysfs_deactivate(sd);
290 sysfs_put(sd);
291 return 0;
288} 292}