Skip to content

Commit 00ec41a

Browse files
author
Al Viro
committed
convert spu_run(2)
all failure exits prior to fdget() are returns, fdput() is immediately followed by return. Reviewed-by: Christian Brauner <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent d8426e6 commit 00ec41a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

arch/powerpc/platforms/cell/spu_syscalls.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,15 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags,
7777

7878
SYSCALL_DEFINE3(spu_run,int, fd, __u32 __user *, unpc, __u32 __user *, ustatus)
7979
{
80-
long ret;
81-
struct fd arg;
8280
CLASS(spufs_calls, calls)();
8381
if (!calls)
8482
return -ENOSYS;
8583

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);
9389
}
9490

9591
#ifdef CONFIG_COREDUMP

0 commit comments

Comments
 (0)