Skip to content

Commit

Permalink
ubifs: ubifs_jnl_write_inode: Fix a memory leak bug
Browse files Browse the repository at this point in the history
When inodes with extended attributes are evicted, xent is not freed in one
exit branch.

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Fixes: 9ca2d73 ("ubifs: Limit number of xattrs per inode")
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Zhihao Cheng authored and Richard Weinberger committed Mar 30, 2020
1 parent 4ab25ac commit 81423c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ubifs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,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);
Expand Down

0 comments on commit 81423c7

Please sign in to comment.