浏览代码

[POWERPC] spufs: Refuse to load the module when not running on cell

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 <dwmw2@infradead.org>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Arnd Bergmann 18 年之前
父节点
当前提交
8f18a15819
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      arch/powerpc/platforms/cell/spufs/inode.c

+ 4 - 0
arch/powerpc/platforms/cell/spufs/inode.c

@@ -600,6 +600,10 @@ spufs_create_root(struct super_block *sb, void *data)
 	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)