aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/configfs/symlink.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c
index faeb4417a10d..0004d18c40ac 100644
--- a/fs/configfs/symlink.c
+++ b/fs/configfs/symlink.c
@@ -140,8 +140,12 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna
140 goto out_put; 140 goto out_put;
141 141
142 ret = type->ct_item_ops->allow_link(parent_item, target_item); 142 ret = type->ct_item_ops->allow_link(parent_item, target_item);
143 if (!ret) 143 if (!ret) {
144 ret = create_link(parent_item, target_item, dentry); 144 ret = create_link(parent_item, target_item, dentry);
145 if (ret && type->ct_item_ops->drop_link)
146 type->ct_item_ops->drop_link(parent_item,
147 target_item);
148 }
145 149
146 config_item_put(target_item); 150 config_item_put(target_item);
147 path_put(&nd.path); 151 path_put(&nd.path);