Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71ebc6fe authored by Jens Axboe's avatar Jens Axboe
Browse files

aio: use iocb_put() instead of open coding it



Replace the percpu_ref_put() + kmem_cache_free() with a call to
iocb_put() instead.

Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a79d40e9
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1886,10 +1886,9 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
		goto out_put_req;
	return 0;
out_put_req:
	percpu_ref_put(&ctx->reqs);
	if (req->ki_eventfd)
		eventfd_ctx_put(req->ki_eventfd);
	kmem_cache_free(kiocb_cachep, req);
	iocb_put(req);
out_put_reqs_available:
	put_reqs_available(ctx, 1);
	return ret;