Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

convert spu_run(2)

all failure exits prior to fdget() are returns, fdput() is immediately
followed by return.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

+5 -9
+5 -9
arch/powerpc/platforms/cell/spu_syscalls.c
··· 77 77 78 78 SYSCALL_DEFINE3(spu_run,int, fd, __u32 __user *, unpc, __u32 __user *, ustatus) 79 79 { 80 - long ret; 81 - struct fd arg; 82 80 CLASS(spufs_calls, calls)(); 83 81 if (!calls) 84 82 return -ENOSYS; 85 83 86 - ret = -EBADF; 87 - arg = fdget(fd); 88 - if (fd_file(arg)) { 89 - ret = calls->spu_run(fd_file(arg), unpc, ustatus); 90 - fdput(arg); 91 - } 92 - return ret; 84 + CLASS(fd, arg)(fd); 85 + if (fd_empty(arg)) 86 + return -EBADF; 87 + 88 + return calls->spu_run(fd_file(arg), unpc, ustatus); 93 89 } 94 90 95 91 #ifdef CONFIG_COREDUMP