Skip to contentSkip to conversation

multiboot: Use signed type for negative error numbers

PATCH In review Kevin Wolf 1 participant 3 messages Nov 18, 2009 – Dec 4, 2009

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 multiboot: Use signed type for negative error numbers

In mb_mod_length a return value is stored that is negative in error case. With an unsigned type the check goes wrong.

---
 hw/pc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/pc.c +1 -1
index 7c791c4..cb3b6c9 100644
@@ -619,7 +619,7 @@ static int load_multiboot(void *fw_cfg,
         uint32_t mb_mod_info = 0x100;
         uint32_t mb_mod_cmdline = 0x300;
         uint32_t mb_mod_start = mh_load_addr;
-        uint32_t mb_mod_length = mb_kernel_size;
+        int mb_mod_length = mb_kernel_size;
         char *next_initrd;
         char *next_space;
         int mb_mod_count = 0;
Signature · 1 line
1.6.2.5
author
#1 lore raw

[Qemu-devel] Patch mismerge (was: [PATCH] multiboot: Use signed type for negative error numbers)

Hi Anthony,

the description of this patch made it into commit 5f370b1, but the content of this commit is obviously nonsense (adds only an empty line). It's still uint32_t in current master. Can you take the patch into your queue once again? It should still apply cleanly.

Kevin

Am 18.11.2009 12:15, schrieb Kevin Wolf:

Quoted 21 lines

In mb_mod_length a return value is stored that is negative in error case. With an unsigned type the check goes wrong.

---
 hw/pc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/pc.c +1 -1
index 7c791c4..cb3b6c9 100644
@@ -619,7 +619,7 @@ static int load_multiboot(void *fw_cfg,
         uint32_t mb_mod_info = 0x100;
         uint32_t mb_mod_cmdline = 0x300;
         uint32_t mb_mod_start = mh_load_addr;
-        uint32_t mb_mod_length = mb_kernel_size;
+        int mb_mod_length = mb_kernel_size;
         char *next_initrd;
         char *next_space;
         int mb_mod_count = 0;
author
#2 lore raw

Re: [Qemu-devel] Patch mismerge

Am 04.12.2009 10:54, schrieb Kevin Wolf:

Quoted 6 lines

Hi Anthony,

the description of this patch made it into commit 5f370b1, but the content of this commit is obviously nonsense (adds only an empty line). It's still uint32_t in current master. Can you take the patch into your queue once again? It should still apply cleanly.

Sorry, looks like you already did and it's just not pushed to master yet.

Kevin