[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230316181303.6583-1-zeming@nfschina.com>
Date: Fri, 17 Mar 2023 02:13:03 +0800
From: Li zeming <zeming@...china.com>
To: axboe@...nel.dk, asml.silence@...il.com
Cc: io-uring@...r.kernel.org, linux-kernel@...r.kernel.org,
Li zeming <zeming@...china.com>
Subject: [PATCH] io_uring: rsrc: Optimize return value variable 'ret'
The function returns here and returns ret directly. It may look better.
Signed-off-by: Li zeming <zeming@...china.com>
---
io_uring/rsrc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index 056f40946ff6..55dc2c505f8a 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -415,11 +415,11 @@ __cold static int io_rsrc_data_alloc(struct io_ring_ctx *ctx,
data = kzalloc(sizeof(*data), GFP_KERNEL);
if (!data)
- return -ENOMEM;
+ return ret;
data->tags = (u64 **)io_alloc_page_table(nr * sizeof(data->tags[0][0]));
if (!data->tags) {
kfree(data);
- return -ENOMEM;
+ return ret;
}
data->nr = nr;
--
2.18.2
Powered by blists - more mailing lists