[PATCH 1/1] fs/adfs: dir: fix error return code in adfs_fplus_read()

From: Zhen Lei
Date: Fri May 07 2021 - 21:43:26 EST


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

Fixes: d79288b4f61b ("fs/adfs: bigdir: calculate and validate directory checkbyte")
Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: Zhen Lei <thunder.leizhen@xxxxxxxxxx>
---
fs/adfs/dir_fplus.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/adfs/dir_fplus.c b/fs/adfs/dir_fplus.c
index 4a15924014da..a6fd847ce0eb 100644
--- a/fs/adfs/dir_fplus.c
+++ b/fs/adfs/dir_fplus.c
@@ -142,6 +142,7 @@ static int adfs_fplus_read(struct super_block *sb, u32 indaddr,
}

if (adfs_fplus_checkbyte(dir) != t->bigdircheckbyte) {
+ ret = -EIO;
adfs_error(sb, "dir %06x checkbyte mismatch\n", indaddr);
goto out;
}
--
2.25.1