grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] loader/linux: Fix type error for reference variable


From: Tianjia Zhang
Subject: [PATCH] loader/linux: Fix type error for reference variable
Date: Mon, 11 Jan 2021 11:04:36 +0800

`relocatable` is defined as type grub_uint8_t, this is also
one byte definition in linux boot protocol. by semantic
definition, it is a bool type. It is not appropriate to
treat it as a four bytes, this patch fix this issue.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
---
 grub-core/loader/i386/linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
index d7e68658f..3a06785b2 100644
--- a/grub-core/loader/i386/linux.c
+++ b/grub-core/loader/i386/linux.c
@@ -736,7 +736,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
       for (align = 0; align < 32; align++)
        if (grub_le_to_cpu32 (lh.kernel_alignment) & (1 << align))
          break;
-      relocatable = grub_le_to_cpu32 (lh.relocatable);
+      relocatable = lh.relocatable;
     }
   else
     {
-- 
2.19.1.3.ge56e4f7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]