summaryrefslogtreecommitdiff
path: root/fs/ubifs
diff options
context:
space:
mode:
authorZhihao Cheng <chengzhihao1@huawei.com>2020-03-03 17:40:22 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-01 13:17:51 +0200
commit17bc3bff02a75f35e009f714ce3db2cb08cc3a34 (patch)
tree44454b9249fd9ae55e788cb7bcd3173c2e5af15b /fs/ubifs
parent535943c46dfcf32018d94da0b8c9ba470a9a8e71 (diff)
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 <chengzhihao1@huawei.com> Fixes: 9ca2d732644484488db3112 ("ubifs: Limit number of xattrs per inode") Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/journal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index a6ae2428e4c9..5f2ac5ef0891 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);