Skip to content

Commit 297a31e

Browse files
Dan Carpenteraxboe
authored andcommitted
io_uring: remove unnecessary NULL checks
The "kmsg" pointer can't be NULL and we have already dereferenced it so a check here would be useless. Reviewed-by: Stefano Garzarella <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 7fbeb95 commit 297a31e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/io_uring.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3075,7 +3075,7 @@ static int io_sendmsg(struct io_kiocb *req, struct io_kiocb **nxt,
30753075
if (req->io)
30763076
return -EAGAIN;
30773077
if (io_alloc_async_ctx(req)) {
3078-
if (kmsg && kmsg->iov != kmsg->fast_iov)
3078+
if (kmsg->iov != kmsg->fast_iov)
30793079
kfree(kmsg->iov);
30803080
return -ENOMEM;
30813081
}
@@ -3229,7 +3229,7 @@ static int io_recvmsg(struct io_kiocb *req, struct io_kiocb **nxt,
32293229
if (req->io)
32303230
return -EAGAIN;
32313231
if (io_alloc_async_ctx(req)) {
3232-
if (kmsg && kmsg->iov != kmsg->fast_iov)
3232+
if (kmsg->iov != kmsg->fast_iov)
32333233
kfree(kmsg->iov);
32343234
return -ENOMEM;
32353235
}

0 commit comments

Comments
 (0)