This reverts commit 7aab03418ec6a9b991aa44416cb2585aff4e 7972. Original commit is wrong because grub_file_get_device_na me can return NULL if we use implicit $root. grub_errno is guaranteed to be 0 at the beginning of a command
Signed-off-by: Vladimir Serbinenko <phco...@gmail.com> --- grub-core/fs/zfs/zfsinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
From e781a9fc826590c2ca70d884a34cf162ef17f152 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko <phco...@gmail.com> Date: Sat, 15 Jul 2023 23:10:20 +0200 Subject: [PATCH] Revert "zfsinfo: Correct a check for error allocating memory" This reverts commit 7aab03418ec6a9b991aa44416cb2585aff4e7972. Original commit is wrong because grub_file_get_device_name can return NULL if we use implicit $root. grub_errno is guaranteed to be 0 at the beginning of a command Signed-off-by: Vladimir Serbinenko <phco...@gmail.com> --- grub-core/fs/zfs/zfsinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/fs/zfs/zfsinfo.c b/grub-core/fs/zfs/zfsinfo.c index bf2918018..c8a28acf5 100644 --- a/grub-core/fs/zfs/zfsinfo.c +++ b/grub-core/fs/zfs/zfsinfo.c @@ -358,8 +358,8 @@ grub_cmd_zfs_bootfs (grub_command_t cmd __attribute__ ((unused)), int argc, return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected")); devname = grub_file_get_device_name (args[0]); - if (devname == NULL) - return GRUB_ERR_OUT_OF_MEMORY; + if (grub_errno) + return grub_errno; dev = grub_device_open (devname); grub_free (devname); -- 2.42.0
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel