diff options
Diffstat (limited to 'fs/sysfs/symlink.c')
-rw-r--r-- | fs/sysfs/symlink.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index c129f307936a..a6b13f12b0e7 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c | |||
@@ -91,14 +91,11 @@ int sysfs_create_link(struct kobject * kobj, struct kobject * target, const char | |||
91 | target_sd = NULL; /* reference is now owned by the symlink */ | 91 | target_sd = NULL; /* reference is now owned by the symlink */ |
92 | 92 | ||
93 | sysfs_addrm_start(&acxt, parent_sd); | 93 | sysfs_addrm_start(&acxt, parent_sd); |
94 | error = sysfs_add_one(&acxt, sd); | ||
95 | sysfs_addrm_finish(&acxt); | ||
94 | 96 | ||
95 | if (!sysfs_find_dirent(parent_sd, name)) | 97 | if (error) |
96 | sysfs_add_one(&acxt, sd); | ||
97 | |||
98 | if (!sysfs_addrm_finish(&acxt)) { | ||
99 | error = -EEXIST; | ||
100 | goto out_put; | 98 | goto out_put; |
101 | } | ||
102 | 99 | ||
103 | return 0; | 100 | return 0; |
104 | 101 | ||