Skip to contentSkip to conversation

ensure XPC and XPNET are loaded on sn2 platforms only

PATCH New Dean Nelson 1 participant 1 message Sep 8, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ensure XPC and XPNET are loaded on sn2 platforms only

These are SN2 only drivers. They should have platform checks to prevent them from doing evil stuff in GENERIC kernels.

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

/*