From 86ff227557dde6398317f0cea9448391314b070a Mon Sep 17 00:00:00 2001
From: Bernhard Walle <bwalle@suse.de>
Date: Mon, 26 May 2008 23:12:58 +0200
Subject: [PATCH] EDD fix

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 <bwalle@suse.de>

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;
 	}
 
