Skip to content

Commit 6acd352

Browse files
Li zemingaxboe
authored andcommitted
io_uring: rsrc: Optimize return value variable 'ret'
The initialization assignment of the variable ret is changed to 0, only in 'goto fail;' Use the ret variable as the function return value. Signed-off-by: Li zeming <zeming@nfschina.com> Link: https://lore.kernel.org/r/20230317182538.3027-1-zeming@nfschina.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent a5fc144 commit 6acd352

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/rsrc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ __cold static int io_rsrc_data_alloc(struct io_ring_ctx *ctx,
410410
unsigned nr, struct io_rsrc_data **pdata)
411411
{
412412
struct io_rsrc_data *data;
413-
int ret = -ENOMEM;
413+
int ret = 0;
414414
unsigned i;
415415

416416
data = kzalloc(sizeof(*data), GFP_KERNEL);

0 commit comments

Comments
 (0)