diff options
Diffstat (limited to 'fs/configfs/symlink.c')
-rw-r--r-- | fs/configfs/symlink.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c index a6ab012a2c6a..c8aabba502f6 100644 --- a/fs/configfs/symlink.c +++ b/fs/configfs/symlink.c | |||
@@ -83,14 +83,13 @@ static int create_link(struct config_item *parent_item, | |||
83 | ret = -ENOMEM; | 83 | ret = -ENOMEM; |
84 | sl = kmalloc(sizeof(struct configfs_symlink), GFP_KERNEL); | 84 | sl = kmalloc(sizeof(struct configfs_symlink), GFP_KERNEL); |
85 | if (sl) { | 85 | if (sl) { |
86 | sl->sl_target = config_item_get(item); | ||
87 | spin_lock(&configfs_dirent_lock); | 86 | spin_lock(&configfs_dirent_lock); |
88 | if (target_sd->s_type & CONFIGFS_USET_DROPPING) { | 87 | if (target_sd->s_type & CONFIGFS_USET_DROPPING) { |
89 | spin_unlock(&configfs_dirent_lock); | 88 | spin_unlock(&configfs_dirent_lock); |
90 | config_item_put(item); | ||
91 | kfree(sl); | 89 | kfree(sl); |
92 | return -ENOENT; | 90 | return -ENOENT; |
93 | } | 91 | } |
92 | sl->sl_target = config_item_get(item); | ||
94 | list_add(&sl->sl_list, &target_sd->s_links); | 93 | list_add(&sl->sl_list, &target_sd->s_links); |
95 | spin_unlock(&configfs_dirent_lock); | 94 | spin_unlock(&configfs_dirent_lock); |
96 | ret = configfs_create_link(sl, parent_item->ci_dentry, | 95 | ret = configfs_create_link(sl, parent_item->ci_dentry, |