]> err.no Git - linux-2.6/commitdiff
[POWERPC] cell: Fix errno for modular spufs_create with invalid neighbour
authorJeremy Kerr <jk@ozlabs.org>
Mon, 13 Aug 2007 03:22:44 +0000 (13:22 +1000)
committerPaul Mackerras <paulus@samba.org>
Wed, 15 Aug 2007 05:12:44 +0000 (15:12 +1000)
At present, spu_create with an invalid neighbo(u)r will return -ENOSYS,
not -EBADF, but only when spufs.o is built as a module.

This change adds the appropriate errno, making the behaviour the same
as the built-in case.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/cell/spu_syscalls.c

index dd2c6688c8aaa6f0bad47ab8b160856b24c34290..027ac32cc63659c8c2af89270041742dcb96e345 100644 (file)
@@ -45,6 +45,7 @@ asmlinkage long sys_spu_create(const char __user *name,
        if (owner && try_module_get(owner)) {
                if (flags & SPU_CREATE_AFFINITY_SPU) {
                        neighbor = fget_light(neighbor_fd, &fput_needed);
+                       ret = -EBADF;
                        if (neighbor) {
                                ret = spufs_calls.create_thread(name, flags,
                                                                mode, neighbor);