summaryrefslogtreecommitdiff
path: root/bios
diff options
context:
space:
mode:
authorBill Rieske <brieske@novell.com>2009-01-09 17:10:55 -0700
committerAvi Kivity <avi@redhat.com>2009-01-11 14:49:32 +0200
commita44755fe3924936e47500cd0f29c192d71df7008 (patch)
tree4c4fce4d203370d0b3dde40f9bce4031b3cf710e /bios
parent5a72c3f0f129954fb2b653736ae2bf618e44e9a1 (diff)
kvm: bios: fix smbios memory device length boundary condition
dev_memsize ends up 0 when it shouldn't be on 16G boundary conditions. Signed-off-by: Bill Rieske <brieske@novell.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'bios')
-rwxr-xr-xbios/rombios32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bios/rombios32.c b/bios/rombios32.c
index ab37e13f..9d2eaaaa 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));