Linux virtualization list
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: cgel.zte@gmail.com
Cc: axboe@kernel.dk, mst@redhat.com, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-block@vger.kernel.org, stefanha@redhat.com,
	Ye Guojin <ye.guojin@zte.com.cn>,
	pbonzini@redhat.com, Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] virtio-blk: modify the value type of num in virtio_queue_rq()
Date: Wed, 17 Nov 2021 10:20:14 +0100	[thread overview]
Message-ID: <20211117092014.qyqhtg2y5etoxrqe@steredhat> (raw)
In-Reply-To: <20211117063955.160777-1-ye.guojin@zte.com.cn>

On Wed, Nov 17, 2021 at 06:39:55AM +0000, cgel.zte@gmail.com wrote:
>From: Ye Guojin <ye.guojin@zte.com.cn>
>
>This was found by coccicheck:
>./drivers/block/virtio_blk.c, 334, 14-17, WARNING Unsigned expression
>compared with zero  num < 0
>

We should add the Fixes tag:

Fixes: 02746e26c39e ("virtio-blk: avoid preallocating big SGL for data")

>Reported-by: Zeal Robot <zealci@zte.com.cn>
>Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
>---
> drivers/block/virtio_blk.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
>index 97bf051a50ce..eed1666eff31 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;
>-- 
>2.25.1
>

The patch LGTM.

With the Fixes tag added:

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

       reply	other threads:[~2021-11-17  9:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211117063955.160777-1-ye.guojin@zte.com.cn>
2021-11-17  9:20 ` Stefano Garzarella [this message]
2021-11-24 15:37 ` [PATCH] virtio-blk: modify the value type of num in virtio_queue_rq() Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211117092014.qyqhtg2y5etoxrqe@steredhat \
    --to=sgarzare@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=cgel.zte@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=ye.guojin@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox