linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] fs/adfs: dir: fix error return code in adfs_fplus_read()
@ 2021-05-08  1:42 Zhen Lei
  0 siblings, 0 replies; only message in thread
From: Zhen Lei @ 2021-05-08  1:42 UTC (permalink / raw)
  To: Al Viro, Russell King, linux-kernel; +Cc: Zhen Lei

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@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-08  1:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08  1:42 [PATCH 1/1] fs/adfs: dir: fix error return code in adfs_fplus_read() Zhen Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).