diff options
author | Ye Guojin <[email protected]> | 2021-11-17 06:39:55 +0000 |
---|---|---|
committer | Michael S. Tsirkin <[email protected]> | 2021-11-24 19:00:28 -0500 |
commit | 0466a39bd0b6c462338f10d18076703d14a552de (patch) | |
tree | 55a5d45568f6fd7ae5fb7b122fa375772d3a9e52 | |
parent | 11708ff92c1dba9aaa59168c46c5317677595942 (diff) |
virtio-blk: modify the value type of num in virtio_queue_rq()
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 <[email protected]>
Signed-off-by: Ye Guojin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Fixes: 02746e26c39e ("virtio-blk: avoid preallocating big SGL for data")
Reviewed-by: Stefano Garzarella <[email protected]>
Reviewed-by: Max Gurtovoy <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
-rw-r--r-- | drivers/block/virtio_blk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 1a1b1189225d..6ae38776e30e 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -316,7 +316,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; bool notify = false; blk_status_t status; |