public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: kill extra iovec=NULL in import_iovec()
@ 2020-08-20  8:34 Pavel Begunkov
  2020-08-20 11:50 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2020-08-20  8:34 UTC (permalink / raw)
  To: Jens Axboe, io-uring

If io_import_iovec() returns an error, return iovec is undefined and
must not be used, so don't set it to NULL when failing.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index ea2d1cb5c422..4fd3c68389cf 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2833,10 +2833,8 @@ static ssize_t io_import_iovec(int rw, struct io_kiocb *req,
 	if (opcode == IORING_OP_READ || opcode == IORING_OP_WRITE) {
 		if (req->flags & REQ_F_BUFFER_SELECT) {
 			buf = io_rw_buffer_select(req, &sqe_len, needs_lock);
-			if (IS_ERR(buf)) {
-				*iovec = NULL;
+			if (IS_ERR(buf))
 				return PTR_ERR(buf);
-			}
 			req->rw.len = sqe_len;
 		}
 
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] io_uring: kill extra iovec=NULL in import_iovec()
  2020-08-20  8:34 [PATCH] io_uring: kill extra iovec=NULL in import_iovec() Pavel Begunkov
@ 2020-08-20 11:50 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2020-08-20 11:50 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On 8/20/20 1:34 AM, Pavel Begunkov wrote:
> If io_import_iovec() returns an error, return iovec is undefined and
> must not be used, so don't set it to NULL when failing.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-20 11:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-20  8:34 [PATCH] io_uring: kill extra iovec=NULL in import_iovec() Pavel Begunkov
2020-08-20 11:50 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox