From: trix@redhat.com
To: mst@redhat.com, jasowang@redhat.com, nathan@kernel.org,
ndesaulniers@google.com
Cc: virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
Tom Rix <trix@redhat.com>
Subject: [PATCH] virtio_ring: Initialize vring_size_in_bytes
Date: Mon, 7 Mar 2022 09:49:16 -0800 [thread overview]
Message-ID: <20220307174916.892433-1-trix@redhat.com> (raw)
From: Tom Rix <trix@redhat.com>
On the clang build, there is this error
virtio_ring.c:1772:26: error: variable 'ring_size_in_bytes'
is uninitialized when used here
vring_free_queue(vdev, ring_size_in_bytes,
^~~~~~~~~~~~~~~~~~
ring_dma_addr was intialized twice, once with the ring_size_in_bytes.
value. So fix typo.
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/virtio/virtio_ring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 905c882600618..b2b567ebb9120 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1756,7 +1756,7 @@ static void vring_free_vring_packed(struct vring_packed *vring,
ring = vring->ring;
driver = vring->driver;
device = vring->device;
- ring_dma_addr = vring->ring_size_in_bytes;
+ ring_size_in_bytes = vring->ring_size_in_bytes;
event_size_in_bytes = vring->event_size_in_bytes;
ring_dma_addr = vring->ring_dma_addr;
driver_event_dma_addr = vring->driver_event_dma_addr;
--
2.26.3
next reply other threads:[~2022-03-07 17:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 17:49 trix [this message]
2022-03-07 17:54 ` [PATCH] virtio_ring: Initialize vring_size_in_bytes Nathan Chancellor
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=20220307174916.892433-1-trix@redhat.com \
--to=trix@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mst@redhat.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.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;
as well as URLs for NNTP newsgroup(s).