aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2017-02-10 11:46:01 -0500
committerRichard Weinberger <richard@nod.at>2017-03-30 03:27:27 -0400
commit63ed657362509b54635fe17af980fba722a008d8 (patch)
treec6615e75adc6c4380270bae40ad1d0a886bd55d5 /fs/ubifs
parent9cd9a21ce070be8a918ffd3381468315a7a76ba6 (diff)
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>
Diffstat (limited to 'fs/ubifs')
-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,
1068 } 1068 }
1069 1069
1070 err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm); 1070 err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm);
1071 if (err) 1071 if (err) {
1072 kfree(dev);
1072 goto out_budg; 1073 goto out_budg;
1074 }
1073 1075
1074 sz_change = CALC_DENT_SIZE(fname_len(&nm)); 1076 sz_change = CALC_DENT_SIZE(fname_len(&nm));
1075 1077