From: Ye Guojin Date: Wed, 17 Nov 2021 06:39:55 +0000 (+0000) Subject: virtio-blk: modify the value type of num in virtio_queue_rq() X-Git-Tag: v5.15.73~2426 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb91c0548ff2b32b591af04c24a8f6e0cf229ab3;p=platform%2Fkernel%2Flinux-rpi.git virtio-blk: modify the value type of num in virtio_queue_rq() commit 0466a39bd0b6c462338f10d18076703d14a552de upstream. This was found by coccicheck: ./drivers/block/virtio_blk.c, 334, 14-17, WARNING Unsigned expression compared with zero num < 0 Reported-by: Zeal Robot Signed-off-by: Ye Guojin Link: https://lore.kernel.org/r/20211117063955.160777-1-ye.guojin@zte.com.cn Signed-off-by: Michael S. Tsirkin Fixes: 02746e26c39e ("virtio-blk: avoid preallocating big SGL for data") Reviewed-by: Stefano Garzarella Reviewed-by: Max Gurtovoy Reviewed-by: Stefan Hajnoczi Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index ccc5770d..d2ba849 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -308,7 +308,7 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req = bd->rq; struct virtblk_req *vbr = blk_mq_rq_to_pdu(req); unsigned long flags; - unsigned int num; + int num; int qid = hctx->queue_num; int err; bool notify = false;