summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2017-02-10 17:46:01 +0100
committerRichard Weinberger <richard@nod.at>2017-03-30 09:27:27 +0200
commit63ed657362509b54635fe17af980fba722a008d8 (patch)
treec6615e75adc6c4380270bae40ad1d0a886bd55d5
parentubi/upd: Always flush after prepared for an update (diff)
downloadlinux-63ed657362509b54635fe17af980fba722a008d8.tar.xz
linux-63ed657362509b54635fe17af980fba722a008d8.zip
ubifs: Fix memory leak in error path in ubifs_mknod
When fscrypt_setup_filename() fails we have to free dev. Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--fs/ubifs/dir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index 30825d882aa9..51929be655c3 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -1068,8 +1068,10 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
}
err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm);
- if (err)
+ if (err) {
+ kfree(dev);
goto out_budg;
+ }
sz_change = CALC_DENT_SIZE(fname_len(&nm));