Revert "zfsinfo: Correct a check for error allocating memory"

Original commit is wrong because grub_file_get_device_name() may return NULL
if we use implicit $root. Additionally, the grub_errno is guaranteed to be
GRUB_ERR_NONE at the beginning of a command. So, everything should work as
expected and Coverity report, CID 73668, WRT to this code should be treated
as false positive.

This reverts commit 7aab03418 (zfsinfo: Correct a check for error allocating memory).

Fixes: 7aab03418 (zfsinfo: Correct a check for error allocating memory)

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2023-10-06 20:23:53 +02:00 committed by Daniel Kiper
parent 4266fd2bb2
commit 4e10213de6

View File

@ -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);