]> git.baikalelectronics.ru Git - kernel.git/commitdiff
io_uring: remove unnecessary NULL checks
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 17 Feb 2020 14:39:45 +0000 (17:39 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 18 Feb 2020 18:22:02 +0000 (11:22 -0700)
The "kmsg" pointer can't be NULL and we have already dereferenced it so
a check here would be useless.

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index 29565d82291f06be268b00bbb9327a8339c42b3f..d35b45696c731f05c0de4bc65595a362a6ed1ea5 100644 (file)
@@ -3075,7 +3075,7 @@ static int io_sendmsg(struct io_kiocb *req, struct io_kiocb **nxt,
                        if (req->io)
                                return -EAGAIN;
                        if (io_alloc_async_ctx(req)) {
-                               if (kmsg && kmsg->iov != kmsg->fast_iov)
+                               if (kmsg->iov != kmsg->fast_iov)
                                        kfree(kmsg->iov);
                                return -ENOMEM;
                        }
@@ -3229,7 +3229,7 @@ static int io_recvmsg(struct io_kiocb *req, struct io_kiocb **nxt,
                        if (req->io)
                                return -EAGAIN;
                        if (io_alloc_async_ctx(req)) {
-                               if (kmsg && kmsg->iov != kmsg->fast_iov)
+                               if (kmsg->iov != kmsg->fast_iov)
                                        kfree(kmsg->iov);
                                return -ENOMEM;
                        }