]> git.ipfire.org Git - thirdparty/grub.git/commit
kern/file: Fix error handling in grub_file_open()
authorSteve McIntyre <steve@einval.com>
Tue, 6 Dec 2022 01:45:11 +0000 (01:45 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 7 Dec 2022 22:38:26 +0000 (23:38 +0100)
commite375394fb9233fb1da13f7fb38e38d8aa83d1443
tree8e39d47af8f0c8fd632316586e1d21dc633e1182
parent012fe7f0550899a2f1cf2fcf48f29ecf4820f880
kern/file: Fix error handling in grub_file_open()

grub_file_open() calls grub_file_get_device_name(), but doesn't check
the return. Instead, it checks if grub_errno is set.

However, nothing initialises grub_errno here when grub_file_open()
starts. This means that trying to open one file that doesn't exist and
then trying to open another file that does will (incorrectly) also
fail to open that second file.

Let's fix that.

Signed-off-by: Steve McIntyre <steve@einval.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/file.c