All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, jvrao@linux.vnet.ibm.com
Subject: [Qemu-trivial] [PATCH 2/2] hw/9pfs: Supply missing va_end()
Date: Fri, 28 Oct 2011 10:52:26 +0200	[thread overview]
Message-ID: <1319791946-15602-3-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1319791946-15602-1-git-send-email-armbru@redhat.com>

C99 7.15.1: Each invocation of the va_start and va_copy macros shall
be matched by a corresponding invocation of the va_end macro in the
same function.

Spotted by Coverity.  Harmless on the (common) systems where va_end()
does nothing.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/9pfs/virtio-9p.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index aab3beb..1e22696 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -231,6 +231,7 @@ v9fs_string_alloc_printf(char **strp, const char *fmt, va_list ap)
                 arg_ulong = va_arg(ap2, unsigned long);
                 len += number_to_string((void *)&arg_ulong, 'U');
             } else {
+                va_end(ap2);
                 return -1;
             }
             break;
@@ -244,11 +245,14 @@ v9fs_string_alloc_printf(char **strp, const char *fmt, va_list ap)
         default:
             fprintf(stderr,
 		    "v9fs_string_alloc_printf:Incorrect format %c", *iter);
+            va_end(ap2);
             return -1;
         }
         iter++;
     }
 
+    va_end(ap2);
+
 alloc_print:
     *strp = g_malloc((len + 1) * sizeof(**strp));
 
-- 
1.7.6.4



WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, jvrao@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 2/2] hw/9pfs: Supply missing va_end()
Date: Fri, 28 Oct 2011 10:52:26 +0200	[thread overview]
Message-ID: <1319791946-15602-3-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1319791946-15602-1-git-send-email-armbru@redhat.com>

C99 7.15.1: Each invocation of the va_start and va_copy macros shall
be matched by a corresponding invocation of the va_end macro in the
same function.

Spotted by Coverity.  Harmless on the (common) systems where va_end()
does nothing.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/9pfs/virtio-9p.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index aab3beb..1e22696 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -231,6 +231,7 @@ v9fs_string_alloc_printf(char **strp, const char *fmt, va_list ap)
                 arg_ulong = va_arg(ap2, unsigned long);
                 len += number_to_string((void *)&arg_ulong, 'U');
             } else {
+                va_end(ap2);
                 return -1;
             }
             break;
@@ -244,11 +245,14 @@ v9fs_string_alloc_printf(char **strp, const char *fmt, va_list ap)
         default:
             fprintf(stderr,
 		    "v9fs_string_alloc_printf:Incorrect format %c", *iter);
+            va_end(ap2);
             return -1;
         }
         iter++;
     }
 
+    va_end(ap2);
+
 alloc_print:
     *strp = g_malloc((len + 1) * sizeof(**strp));
 
-- 
1.7.6.4

  parent reply	other threads:[~2011-10-28  8:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28  8:52 [Qemu-trivial] [PATCH 0/2] Trivial portability fix: missing va_end() Markus Armbruster
2011-10-28  8:52 ` [Qemu-devel] " Markus Armbruster
2011-10-28  8:52 ` [Qemu-trivial] [PATCH 1/2] sysbus: Supply " Markus Armbruster
2011-10-28  8:52   ` [Qemu-devel] " Markus Armbruster
2011-10-31 11:52   ` [Qemu-trivial] " Stefan Hajnoczi
2011-10-31 11:52     ` Stefan Hajnoczi
2011-10-28  8:52 ` Markus Armbruster [this message]
2011-10-28  8:52   ` [Qemu-devel] [PATCH 2/2] hw/9pfs: " Markus Armbruster
2011-10-31 11:51   ` [Qemu-trivial] " Stefan Hajnoczi
2011-10-31 11:51     ` [Qemu-devel] " 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=1319791946-15602-3-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=jvrao@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.