Skip to contentSkip to conversation

x86/setup change for v2.6.40

GIT PULL Ingo Molnar 1 participant 1 message May 19, 2011

lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest x86-setup-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86-setup-for-linus

out-of-topic modifications in x86-setup-for-linus:
--------------------------------------------------
drivers/firmware/edd.c # 0c61227: x86, setup: Fix EDD3.0 data verif

Thanks,

Ingo

------------------>
Gleb Natapov (1):
x86, setup: Fix EDD3.0 data verification.

 drivers/firmware/edd.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)
drivers/firmware/edd.c +11 -11
index 96c25d9..f1b7f65 100644
@@ -531,8 +531,8 @@ static int
 edd_has_edd30(struct edd_device *edev)
 {
 	struct edd_info *info;
-	int i, nonzero_path = 0;
-	char c;
+	int i;
+	u8 csum = 0;
 
 	if (!edev)
 		return 0;
@@ -544,16 +544,16 @@ edd_has_edd30(struct edd_device *edev)
 		return 0;
 	}
 
-	for (i = 30; i <= 73; i++) {
-		c = *(((uint8_t *) info) + i + 4);
-		if (c) {
-			nonzero_path++;
-			break;
-		}
-	}
-	if (!nonzero_path) {
+
+	/* We support only T13 spec */
+	if (info->params.device_path_info_length != 44)
+		return 0;
+
+	for (i = 30; i < info->params.device_path_info_length + 30; i++)
+		csum += *(((u8 *)&info->params) + i);
+
+	if (csum)
 		return 0;
-	}
 
 	return 1;
 }