fix smbios memory device length boundary condition
diff mbox

Message ID 4967851F0200008B00061955@lucius.provo.novell.com
State Accepted, archived
Headers show

Commit Message

Bill Rieske Jan. 10, 2009, 12:10 a.m. UTC
dev_memsize ends up 0 when it shouldn't be on 16G boundary conditions.

Signed-off-by: Bill Rieske <brieske@novell.com>



--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Avi Kivity Jan. 11, 2009, 12:49 p.m. UTC | #1
Bill Rieske wrote:
> dev_memsize ends up 0 when it shouldn't be on 16G boundary conditions.
>   

Applied, thanks.

Patch
diff mbox

diff --git a/bios/rombios32.c b/bios/rombios32.c
index ab37e13..9d2eaaa 100755
--- a/bios/rombios32.c
+++ b/bios/rombios32.c
@@ -2115,7 +2115,7 @@  void smbios_init(void)
     for ( i = 0; i < nr_mem_devs; i++ )
     {
         uint32_t dev_memsize = ((i == (nr_mem_devs - 1))
-                                ? (memsize & 0x3fff) : 0x4000);
+                                ? (((memsize-1) & 0x3fff)+1) : 0x4000);
         add_struct(smbios_type_17_init(p, dev_memsize, i));
         add_struct(smbios_type_19_init(p, dev_memsize, i));
         add_struct(smbios_type_20_init(p, dev_memsize, i));