From d5e5cc7f96a40a15946bedc746c5b7fc3045bcb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E5=9C=A8?= Date: Fri, 10 May 2024 17:45:07 +0800 Subject: [PATCH] Clean up redundant code In grub-core/fs/jfs.c, Coverity spotted redundant code where the pointer diro was being set to 0 and then being overwritten later without being used. Since this is unnecessary, we can remove the code that sets diro to 0. --- Clean-up-redundant-code.patch | 24 ++++++++++++++++++++++++ grub.patches | 1 + grub2.spec | 11 ++++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 Clean-up-redundant-code.patch diff --git a/Clean-up-redundant-code.patch b/Clean-up-redundant-code.patch new file mode 100644 index 0000000..a75f8ba --- /dev/null +++ b/Clean-up-redundant-code.patch @@ -0,0 +1,24 @@ +From 225a7e36ff703a63f5caf04d0ec8d84e0386c845 Mon Sep 17 00:00:00 2001 +From: openEuler Buildteam +Date: Fri, 10 May 2024 17:32:32 +0800 +Subject: [PATCH] Clean up redundant code + +--- + grub-core/fs/jfs.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/grub-core/fs/jfs.c b/grub-core/fs/jfs.c +index 6f7c439..62e20ef 100644 +--- a/grub-core/fs/jfs.c ++++ b/grub-core/fs/jfs.c +@@ -716,7 +716,6 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path, + grub_uint32_t dirino = grub_le_to_cpu32 (data->currinode.inode); + + grub_jfs_closedir (diro); +- diro = 0; + + if (grub_jfs_read_inode (data, ino, &data->currinode)) + break; +-- +2.33.0 + diff --git a/grub.patches b/grub.patches index 97ff027..fc912d2 100644 --- a/grub.patches +++ b/grub.patches @@ -227,3 +227,4 @@ Patch226: 0038-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch Patch227: 0084-grub-editenv-Add-incr-command-to-increment-integer-v.patch Patch228: 0002-Revert-templates-Properly-disable-the-os-prober-by-d.patch Patch229: 0003-Revert-templates-Disable-the-os-prober-by-default.patch +Patch230: Clean-up-redundant-code.patch diff --git a/grub2.spec b/grub2.spec index 96d5b6e..920bc06 100644 --- a/grub2.spec +++ b/grub2.spec @@ -14,7 +14,7 @@ Name: grub2 Epoch: 1 Version: 2.12 -Release: 9 +Release: 10 Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -447,6 +447,15 @@ fi %{_datadir}/man/man* %changelog +* Fri May 10 2024 xiaozai - 1:2.12-10 +- Type:enhancement +- CVE:NA +- SUG:NA +- DESC:Clean up redundant code + In grub-core/fs/jfs.c, Coverity spotted redundant code where the pointer diro + was being set to 0 and then being overwritten later without being used. Since + this is unnecessary, we can remove the code that sets diro to 0. + * Tue May 7 2024 zhangqiumiao - 1:2.12-9 - Type:bugfix - CVE:NA -- Gitee