diff mbox

[PULL,03/18] vring: factor common code for error exits

Message ID CAFEAcA9qJf=R_por8yh7utBkxHrhWxg_JQk55i7PuosdAtSJBA@mail.gmail.com
State Not Applicable
Headers show

Commit Message

Peter Maydell Jan. 13, 2014, 10:18 a.m. UTC
On 20 December 2013 15:46, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  hw/block/dataplane/virtio-blk.c |  1 +
>  hw/virtio/dataplane/vring.c     | 34 +++++++++++++++++++++-------------
>  2 files changed, 22 insertions(+), 13 deletions(-)

This results in a compile warning on gcc 4.6.3, I'm afraid:

/home/petmay01/linaro/qemu-from-laptop/qemu/hw/virtio/dataplane/vring.c:
In function ‘vring_pop’:
/home/petmay01/linaro/qemu-from-laptop/qemu/hw/virtio/dataplane/vring.c:400:29:
error: ‘ret’ may be used uninitialised in this function
[-Werror=uninitialized]

As you suggested on irc, this fixes it:


thanks
-- PMM
diff mbox

Patch

diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
index 250d45e..665a1ff 100644
--- a/hw/virtio/dataplane/vring.c
+++ b/hw/virtio/dataplane/vring.c
@@ -376,7 +376,7 @@  int vring_pop(VirtIODevice *vdev, Vring *vring,
         barrier();

         if (desc.flags & VRING_DESC_F_INDIRECT) {
-            int ret = get_indirect(vring, elem, &desc);
+            ret = get_indirect(vring, elem, &desc);
             if (ret < 0) {
                 goto out;
             }