Skip to content

Commit

Permalink
fs/adfs: bigdir: Fix an error code in adfs_fplus_read()
Browse files Browse the repository at this point in the history
This code accidentally returns success, but it should return the
-EIO error code from adfs_fplus_validate_header().

Acked-by: Russell King <[email protected]>
Fixes: d79288b ("fs/adfs: bigdir: calculate and validate directory checkbyte")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Dan Carpenter authored and Al Viro committed Jan 25, 2020
1 parent 76ed99d commit 587065d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/adfs/dir_fplus.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ static int adfs_fplus_read(struct super_block *sb, u32 indaddr,
return ret;

dir->bighead = h = (void *)dir->bhs[0]->b_data;
if (adfs_fplus_validate_header(h)) {
ret = adfs_fplus_validate_header(h);
if (ret) {
adfs_error(sb, "dir %06x has malformed header", indaddr);
goto out;
}
Expand Down

0 comments on commit 587065d

Please sign in to comment.