From 62ffbac86c660e537af0be0fb1c7457ee25bf53e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 14 Apr 2009 12:01:07 -0700 Subject: [PATCH] MEMDISK: fix MBR geometry extraction Fix the MBR geometry extraction; there was an off-by-2 error in the MBR signature offset. Signed-off-by: H. Peter Anvin --- memdisk/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memdisk/setup.c b/memdisk/setup.c index 0fee982..6507e56 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -565,7 +565,7 @@ const struct geometry *get_disk_image_geometry(uint32_t where, uint32_t size) hd_geometry.driveno = 0x80; /* Assume hard disk */ - if (*(uint16_t *)((char *)where+512) == 0xaa55) + if (*(uint16_t *)((char *)where+512-2) == 0xaa55) for ( i = 0 ; i < 4 ; i++ ) { if ( ptab[i].type && !(ptab[i].active & 0x7f) ) { s = (ptab[i].start_s & 0x3f); -- 2.7.4