代码拉取完成,页面将自动刷新
同步操作将从 余诗/grub2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From d09387287b7bbd7770bc9d172cc0e06181183e02 Mon Sep 17 00:00:00 2001
From: Oliver Steffen <osteffen@redhat.com>
Date: Fri, 26 May 2023 13:35:50 +0200
Subject: kern: Check for NULL when closing devices and disks
Add checks for NULL pointers to grub_device_close() and
grub_disk_close() to make these functions more robust.
Reference:https://git.savannah.gnu.org/cgit/grub.git/commit?id=d09387287b7bbd7770bc9d172cc0e06181183e02
Conflict:NA
Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
grub-core/kern/device.c | 3 +++
grub-core/kern/disk.c | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/grub-core/kern/device.c b/grub-core/kern/device.c
index f58b58c..2a6d81f 100644
--- a/grub-core/kern/device.c
+++ b/grub-core/kern/device.c
@@ -72,6 +72,9 @@ grub_device_open (const char *name)
grub_err_t
grub_device_close (grub_device_t device)
{
+ if (device == NULL)
+ return GRUB_ERR_NONE;
+
if (device->disk)
grub_disk_close (device->disk);
diff --git a/grub-core/kern/disk.c b/grub-core/kern/disk.c
index 05a28ab..3ca8528 100644
--- a/grub-core/kern/disk.c
+++ b/grub-core/kern/disk.c
@@ -294,6 +294,10 @@ void
grub_disk_close (grub_disk_t disk)
{
grub_partition_t part;
+
+ if (disk == NULL)
+ return;
+
grub_dprintf ("disk", "Closing `%s'...\n", disk->name);
if (disk->dev && disk->dev->disk_close)
--
2.19.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。