[PATCH] ensure XPC and XPNET are loaded on sn2 platforms only

From: Dean Nelson <dcn_at_sgi.com>
Date: 2005-09-09 01:46:58
These are SN2 only drivers.  They should have platform checks to prevent
them from doing evil stuff in GENERIC kernels.

Signed-off-by: Martin Hicks <mort@sgi.com>
Acked-by: Dean Nelson <dcn@sgi.com>


 arch/ia64/sn/kernel/xpc_main.c |    4 ++++
 arch/ia64/sn/kernel/xpnet.c    |    4 ++++
 2 files changed, 8 insertions(+)


Index: linux-2.6/arch/ia64/sn/kernel/xpc_main.c
===================================================================
--- linux-2.6.orig/arch/ia64/sn/kernel/xpc_main.c	2005-09-08 06:58:26.134622631 -0500
+++ linux-2.6/arch/ia64/sn/kernel/xpc_main.c	2005-09-08 09:47:31.081587119 -0500
@@ -885,6 +885,10 @@
 	pid_t pid;
 
 
+	if (!ia64_platform_is("sn2")) {
+		return -ENODEV;
+	}
+
 	/*
 	 * xpc_remote_copy_buffer is used as a temporary buffer for bte_copy'ng
 	 * both a partition's reserved page and its XPC variables. Its size was
Index: linux-2.6/arch/ia64/sn/kernel/xpnet.c
===================================================================
--- linux-2.6.orig/arch/ia64/sn/kernel/xpnet.c	2005-09-08 06:58:26.136575561 -0500
+++ linux-2.6/arch/ia64/sn/kernel/xpnet.c	2005-09-08 09:47:36.693330520 -0500
@@ -636,6 +636,10 @@
 	int result = -ENOMEM;
 
 
+	if (!ia64_platform_is("sn2")) {
+		return -ENODEV;
+	}
+
 	dev_info(xpnet, "registering network device %s\n", XPNET_DEVICE_NAME);
 
 	/*
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Fri Sep 09 01:49:36 2005

This archive was generated by hypermail 2.1.8 : 2005-09-09 01:49:42 EST