This patch fixes EDD support where the BIOS reports a length lower than the
actual length of raw_data in sysfs. That's no problem -- the check only
needs to catch the case where the sysfs file is *smaller* than the
BIOS reported length.

Also add a newline at the end of the error message.

The problem was introduced in 3bf0213789d56054f601c5a06372f78567aacdd9 by
myself, the initial EDD implementation.


Signed-off-by: Bernhard Walle <[EMAIL PROTECTED]>
---
 kexec/arch/i386/x86-linux-setup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kexec/arch/i386/x86-linux-setup.c 
b/kexec/arch/i386/x86-linux-setup.c
index 05a087e..cbb9d30 100644
--- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c
@@ -254,9 +254,9 @@ static int read_edd_raw_data(const char *dir, struct 
edd_info *edd_info)
        len = ((uint16_t *)edd_info->edd_device_params)[0];
        dbgprintf("EDD raw data has length %d\n", len);
 
-       if (read_chars != len) {
+       if (read_chars < len) {
                fprintf(stderr, "BIOS reported EDD length of %hd but only "
-                       "%d chars read.", len, (int)read_chars);
+                       "%d chars read.\n", len, (int)read_chars);
                return -1;
        }
 
-- 
1.5.4.5


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to