]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring/zcrx: replace memchar_inv with is_zero
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 16 Sep 2025 14:27:45 +0000 (15:27 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 16 Sep 2025 18:37:20 +0000 (12:37 -0600)
memchr_inv() is more ambiguous than mem_is_zero(), so use the latter
for zero checks.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/zcrx.c

index c02045e4c1b65f2700bcfb2be26f935eef6bbca4..a4a0560e8269331d928c40b4e8693ebc1378e0b3 100644 (file)
@@ -566,7 +566,7 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
                return -EFAULT;
        if (copy_from_user(&rd, u64_to_user_ptr(reg.region_ptr), sizeof(rd)))
                return -EFAULT;
-       if (memchr_inv(&reg.__resv, 0, sizeof(reg.__resv)) ||
+       if (!mem_is_zero(&reg.__resv, sizeof(reg.__resv)) ||
            reg.__resv2 || reg.zcrx_id)
                return -EINVAL;
        if (reg.if_rxq == -1 || !reg.rq_entries || reg.flags)