fs/f2fs: Set a grub_errno if mount fails

It was previously possible for grub_errno to not be set when
grub_f2fs_mount() failed if nat_bitmap_ptr() returned NULL.

This issue is solved by ensuring a grub_errno is set in the fail case.

Reported-by: B Horn <b@horn.uk>
Signed-off-by: B Horn <b@horn.uk>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
B Horn 2024-05-12 06:15:03 +01:00 committed by Daniel Kiper
parent 0087bc6902
commit 563436258c

View File

@ -872,6 +872,9 @@ grub_f2fs_mount (grub_disk_t disk)
return data;
fail:
if (grub_errno == GRUB_ERR_NONE)
grub_error (GRUB_ERR_BAD_FS, "not a F2FS filesystem");
grub_free (data);
return NULL;