ext4: set error return correctly when ext4_htree_store_dirent fails
authorColin Ian King <colin.king@canonical.com>
Mon, 12 Aug 2019 18:29:38 +0000 (14:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jan 2020 09:24:29 +0000 (10:24 +0100)
commit24328d5173345c6c2c0aaa991e229cc9cd01e692
tree54a4f7b99c7c5f86f02468d5e16e864ae37ecbc2
parent38945c87f1b6fd85800105e820387aac4e4a7943
ext4: set error return correctly when ext4_htree_store_dirent fails

[ Upstream commit 7a14826ede1d714f0bb56de8167c0e519041eeda ]

Currently when the call to ext4_htree_store_dirent fails the error return
variable 'ret' is is not being set to the error code and variable count is
instead, hence the error code is not being returned.  Fix this by assigning
ret to the error return code.

Addresses-Coverity: ("Unused value")
Fixes: 8af0f0822797 ("ext4: fix readdir error in the case of inline_data+dir_index")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/inline.c