From: Zhihao Cheng Date: Tue, 3 Mar 2020 09:40:22 +0000 (+0800) Subject: ubifs: ubifs_jnl_write_inode: Fix a memory leak bug X-Git-Tag: v5.4.69~178 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=17bc3bff02a75f35e009f714ce3db2cb08cc3a34;p=users%2Fdwmw2%2Flinux.git ubifs: ubifs_jnl_write_inode: Fix a memory leak bug [ Upstream commit 81423c78551654953d746250f1721300b470be0e ] When inodes with extended attributes are evicted, xent is not freed in one exit branch. Signed-off-by: Zhihao Cheng Fixes: 9ca2d732644484488db3112 ("ubifs: Limit number of xattrs per inode") Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index a6ae2428e4c96..5f2ac5ef0891e 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -906,6 +906,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode) ubifs_err(c, "dead directory entry '%s', error %d", xent->name, err); ubifs_ro_mode(c, err); + kfree(xent); goto out_release; } ubifs_assert(c, ubifs_inode(xino)->xattr);