浏览代码

[PATCH] Fix pSeries identification in prom_init.c

The OF trampoline code prom_init.c still needs to identify IBM pSeries
(PAPR) machines in order to run some platform specific code on them like
instanciating the TCE tables. The code doing that detection was changed
recently in 2.6.17 early stages but was done slightly incorrectly. It
should be testing for an exact match of "chrp" and it currently tests
for anything that begins with "chrp". That means it will incorrectly
match with platforms using Maple-like device-trees and have open
firmware. This fixes it by using strcmp instead of strncmp to match what
the actual platform detection code does.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Benjamin Herrenschmidt 19 年之前
父节点
当前提交
cb6b2eb9bc
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/powerpc/kernel/prom_init.c

+ 1 - 1
arch/powerpc/kernel/prom_init.c

@@ -1636,7 +1636,7 @@ static int __init prom_find_machine_type(void)
 			   compat, sizeof(compat)-1);
 			   compat, sizeof(compat)-1);
 	if (len <= 0)
 	if (len <= 0)
 		return PLATFORM_GENERIC;
 		return PLATFORM_GENERIC;
-	if (strncmp(compat, RELOC("chrp"), 4))
+	if (strcmp(compat, RELOC("chrp")))
 		return PLATFORM_GENERIC;
 		return PLATFORM_GENERIC;
 
 
 	/* Default to pSeries. We need to know if we are running LPAR */
 	/* Default to pSeries. We need to know if we are running LPAR */