From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH 1/2] vdpa: Signedness bugs in vdpasim_work()
Date: Mon, 6 Apr 2020 17:45:09 +0300 [thread overview]
Message-ID: <20200406144509.GE68494@mwanda> (raw)
The "read" and "write" variables need to be signed for the error
handling to work.
Fixes: 2c53d0f64c06 ("vdpasim: vDPA device simulator")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/vdpa/vdpa_sim/vdpa_sim.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index 6e8a0cf2fdeb..b3c800653056 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -132,7 +132,8 @@ static void vdpasim_work(struct work_struct *work)
vdpasim, work);
struct vdpasim_virtqueue *txq = &vdpasim->vqs[1];
struct vdpasim_virtqueue *rxq = &vdpasim->vqs[0];
- size_t read, write, total_write;
+ ssize_t read, write;
+ size_t total_write;
int err;
int pkts = 0;
--
2.25.1
next reply other threads:[~2020-04-06 14:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-06 14:45 Dan Carpenter [this message]
2020-04-06 14:45 ` [PATCH 2/2] vdpa: Fix pointer math bug in vdpasim_get_config() Dan Carpenter
2020-04-09 2:06 ` Jason Wang
2020-04-09 2:05 ` [PATCH 1/2] vdpa: Signedness bugs in vdpasim_work() Jason Wang
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=20200406144509.GE68494@mwanda \
--to=dan.carpenter@oracle.com \
--cc=jasowang@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/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