From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: To: From: Jeremy Kerr Date: Mon, 04 Jun 2007 21:26:51 +0800 Subject: [PATCH 1/6] spufs: refuse loading the module when not running on cell Message-Id: <1180963611.745771.662168275092.qpush@pokey> Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Arnd Bergmann As noticed by David Woodhouse, it's currently possible to mount spufs on any machine, which means that it actually will get mounted by fedora. This refuses to load the module on platforms that have no support for SPUs. Cc: David Woodhouse Signed-off-by: Arnd Bergmann Signed-off-by: Jeremy Kerr --- arch/powerpc/platforms/cell/spufs/inode.c | 4 ++++ 1 file changed, 4 insertions(+) Index: linux-2.6-spufs/arch/powerpc/platforms/cell/spufs/inode.c =================================================================== --- linux-2.6-spufs.orig/arch/powerpc/platforms/cell/spufs/inode.c +++ linux-2.6-spufs/arch/powerpc/platforms/cell/spufs/inode.c @@ -600,6 +600,10 @@ spufs_create_root(struct super_block *sb struct inode *inode; int ret; + ret = -ENODEV; + if (!spu_management_ops) + goto out; + ret = -ENOMEM; inode = spufs_new_inode(sb, S_IFDIR | 0775); if (!inode)