Skip to content

Commit

Permalink
ubifs: journal: Fix error return code in ubifs_jnl_write_inode()
Browse files Browse the repository at this point in the history
[ Upstream commit a2c2a62 ]

Fix to return a negative error code from the error handling case instead
of 0, as done elsewhere in this function.

Fixes: 9ca2d73 ("ubifs: Limit number of xattrs per inode")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Zhen Lei authored and gregkh committed Jul 20, 2021
1 parent fe597a0 commit f55dd38
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ubifs/journal.c
Expand Up @@ -882,6 +882,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode)
struct ubifs_dent_node *xent, *pxent = NULL;

if (ui->xattr_cnt > ubifs_xattr_max_cnt(c)) {
err = -EPERM;
ubifs_err(c, "Cannot delete inode, it has too much xattrs!");
goto out_release;
}
Expand Down

0 comments on commit f55dd38

Please sign in to comment.