* [PATCH] ubifs: Fix memory leak in error path in ubifs_mknod
@ 2017-02-10 16:46 Richard Weinberger
0 siblings, 0 replies; only message in thread
From: Richard Weinberger @ 2017-02-10 16:46 UTC (permalink / raw)
To: linux-mtd
Cc: linux-kernel, dedekind1, david.oberhollenzer, Richard Weinberger
When fscrypt_setup_filename() fails we have to free dev.
Signed-off-by: Richard Weinberger <richard@nod.at>
---
fs/ubifs/dir.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index 528369f3e472..e164782f8bc8 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));
--
2.10.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-02-10 19:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-10 16:46 [PATCH] ubifs: Fix memory leak in error path in ubifs_mknod Richard Weinberger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.