diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2024-06-09 22:56:21 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2024-11-03 01:28:07 -0500 |
commit | 00ec41ac16042e8909dc09538d174b3457b1a866 (patch) | |
tree | 7e375d83f99c17953d209e50068e54cf6c3cd0eb | |
parent | d8426e69720a19be7964e014adafc643d27e9e7b (diff) | |
download | linux-00ec41ac16042e8909dc09538d174b3457b1a866.tar.gz linux-00ec41ac16042e8909dc09538d174b3457b1a866.tar.bz2 linux-00ec41ac16042e8909dc09538d174b3457b1a866.zip |
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>
-rw-r--r-- | arch/powerpc/platforms/cell/spu_syscalls.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c index 64a4c9eac6e0..000894e07b02 100644 --- a/arch/powerpc/platforms/cell/spu_syscalls.c +++ b/arch/powerpc/platforms/cell/spu_syscalls.c @@ -77,19 +77,15 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags, SYSCALL_DEFINE3(spu_run,int, fd, __u32 __user *, unpc, __u32 __user *, ustatus) { - long ret; - struct fd arg; CLASS(spufs_calls, calls)(); if (!calls) return -ENOSYS; - ret = -EBADF; - arg = fdget(fd); - if (fd_file(arg)) { - ret = calls->spu_run(fd_file(arg), unpc, ustatus); - fdput(arg); - } - return ret; + CLASS(fd, arg)(fd); + if (fd_empty(arg)) + return -EBADF; + + return calls->spu_run(fd_file(arg), unpc, ustatus); } #ifdef CONFIG_COREDUMP |