lkml.org 
[lkml]   [2022]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] io_uring: Optimizing return value
Date
Delete return value ret Initialize assignment, change return value ret
to EOPNOTSUPP when IO_IS_URING_FOPS failed.

Signed-off-by: Zhang chunchao <chunchao@nfschina.com>
---
io_uring/io_uring.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index b54218da075c..1b56f3d1a47b 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -3859,16 +3859,17 @@ SYSCALL_DEFINE4(io_uring_register, unsigned int, fd, unsigned int, opcode,
void __user *, arg, unsigned int, nr_args)
{
struct io_ring_ctx *ctx;
- long ret = -EBADF;
+ long ret;
struct fd f;

f = fdget(fd);
if (!f.file)
return -EBADF;

- ret = -EOPNOTSUPP;
- if (!io_is_uring_fops(f.file))
+ if (!io_is_uring_fops(f.file)) {
+ ret = -EOPNOTSUPP;
goto out_fput;
+ }

ctx = f.file->private_data;

--
2.18.2
\
 
 \ /
  Last update: 2022-08-12 04:00    [W:0.024 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site