io_uring: fix two assignments in if conditions
[linux-block.git] / io_uring / net.c
index 966019fcbe8c7618da830fa5d5fcdd68be337ca2..f32e0daeedd81183498889d90a0a02d80eb516a6 100644 (file)
@@ -125,13 +125,15 @@ static struct io_async_msghdr *io_msg_alloc_async(struct io_kiocb *req,
        struct io_cache_entry *entry;
        struct io_async_msghdr *hdr;
 
-       if (!(issue_flags & IO_URING_F_UNLOCKED) &&
-           (entry = io_alloc_cache_get(&ctx->netmsg_cache)) != NULL) {
-               hdr = container_of(entry, struct io_async_msghdr, cache);
-               hdr->free_iov = NULL;
-               req->flags |= REQ_F_ASYNC_DATA;
-               req->async_data = hdr;
-               return hdr;
+       if (!(issue_flags & IO_URING_F_UNLOCKED)) {
+               entry = io_alloc_cache_get(&ctx->netmsg_cache);
+               if (entry) {
+                       hdr = container_of(entry, struct io_async_msghdr, cache);
+                       hdr->free_iov = NULL;
+                       req->flags |= REQ_F_ASYNC_DATA;
+                       req->async_data = hdr;
+                       return hdr;
+               }
        }
 
        if (!io_alloc_async_data(req)) {