From: "Vladimir 'phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [PATCH] Revert "zfsinfo: Correct a check for error allocating memory"
Date: Fri, 6 Oct 2023 20:23:53 +0200 [thread overview]
Message-ID: <CAEaD8JPRm4pXrCTG8ysWjOxjU_Niw6_i-WJv31qSVXwDiu3AFw@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 456 bytes --]
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 <phcoder@gmail.com> ---
grub-core/fs/zfs/zfsinfo.c | 4 ++-- 1 file changed, 2
insertions(+), 2 deletions(-)
[-- Attachment #1.2: Type: text/html, Size: 804 bytes --]
[-- Attachment #2: 0001-Revert-zfsinfo-Correct-a-check-for-error-allocating-.patch --]
[-- Type: text/x-diff, Size: 1181 bytes --]
From e781a9fc826590c2ca70d884a34cf162ef17f152 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@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 <phcoder@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
[-- Attachment #3: Type: text/plain, Size: 141 bytes --]
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next reply other threads:[~2023-10-06 18:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 18:23 Vladimir 'phcoder' Serbinenko [this message]
2023-10-09 15:10 ` [PATCH] Revert "zfsinfo: Correct a check for error allocating memory" Daniel Kiper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEaD8JPRm4pXrCTG8ysWjOxjU_Niw6_i-WJv31qSVXwDiu3AFw@mail.gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).