summaryrefslogtreecommitdiff
path: root/fs/debugfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/debugfs/inode.c')
-rw-r--r--fs/debugfs/inode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 4b263c328ed2..4005d21cf009 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -841,8 +841,10 @@ int __printf(2, 3) debugfs_change_name(struct dentry *dentry, const char *fmt, .
rd.new_parent = rd.old_parent;
rd.flags = RENAME_NOREPLACE;
target = lookup_noperm_unlocked(&QSTR(new_name), rd.new_parent);
- if (IS_ERR(target))
- return PTR_ERR(target);
+ if (IS_ERR(target)) {
+ error = PTR_ERR(target);
+ goto out_free;
+ }
error = start_renaming_two_dentries(&rd, dentry, target);
if (error) {
@@ -862,6 +864,7 @@ int __printf(2, 3) debugfs_change_name(struct dentry *dentry, const char *fmt, .
out:
dput(rd.old_parent);
dput(target);
+out_free:
kfree_const(new_name);
return error;
}