mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 14:59:34 +00:00
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 commit7aab03418(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:
1 parent
4266fd2bb2
commit
4e10213de6
1 file changed
+2
-2
@@ -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"));
|
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||||
|
|
||||||
devname = grub_file_get_device_name (args[0]);
|
devname = grub_file_get_device_name (args[0]);
|
||||||
if (devname == NULL)
|
if (grub_errno)
|
||||||
return GRUB_ERR_OUT_OF_MEMORY;
|
return grub_errno;
|
||||||
|
|
||||||
dev = grub_device_open (devname);
|
dev = grub_device_open (devname);
|
||||||
grub_free (devname);
|
grub_free (devname);
|
||||||
|
|||||||
Reference in new issue
Block a user