summaryrefslogtreecommitdiffstats
path: root/fs/sysfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r--fs/sysfs/inode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index efb4062fe09..e22db6cd4df 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -200,7 +200,10 @@ int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const char *name)
if (sd)
sysfs_remove_one(&acxt, sd);
- if (sysfs_addrm_finish(&acxt))
+ sysfs_addrm_finish(&acxt);
+
+ if (sd)
return 0;
- return -ENOENT;
+ else
+ return -ENOENT;
}