summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-06-07 10:16:53 +0000
committerphk <phk@FreeBSD.org>2003-06-07 10:16:53 +0000
commit69b4e9ce0114dea78c811d6c01cd8ebd9b810fc5 (patch)
treee42f41384b3d3867c6ecb12f9c7c63491a6db503
parent10afeb827154cef535bf9fb2c0fc4a2d5af0849d (diff)
downloadFreeBSD-src-69b4e9ce0114dea78c811d6c01cd8ebd9b810fc5.zip
FreeBSD-src-69b4e9ce0114dea78c811d6c01cd8ebd9b810fc5.tar.gz
Add missing va_end() calls.
Noticed by: tmm
-rw-r--r--sys/geom/geom_ctl.c1
-rw-r--r--sys/geom/geom_dump.c1
-rw-r--r--sys/geom/geom_event.c11
-rw-r--r--sys/geom/geom_slice.c3
-rw-r--r--sys/geom/geom_subr.c6
5 files changed, 15 insertions, 7 deletions
diff --git a/sys/geom/geom_ctl.c b/sys/geom/geom_ctl.c
index c113076..0d6edfd 100644
--- a/sys/geom/geom_ctl.c
+++ b/sys/geom/geom_ctl.c
@@ -102,6 +102,7 @@ gctl_error(struct gctl_req *req, const char *fmt, ...)
va_start(ap, fmt);
sbuf_vprintf(req->serror, fmt, ap);
+ va_end(ap);
sbuf_finish(req->serror);
if (g_debugflags & G_F_CTLDUMP)
printf("gctl %p error \"%s\"\n", req, sbuf_data(req->serror));
diff --git a/sys/geom/geom_dump.c b/sys/geom/geom_dump.c
index c56a25d..a21a6bc 100644
--- a/sys/geom/geom_dump.c
+++ b/sys/geom/geom_dump.c
@@ -270,6 +270,7 @@ g_trace(int level, const char *fmt, ...)
return;
va_start(ap, fmt);
vprintf(fmt, ap);
+ va_end(ap);
printf("\n");
}
diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c
index cf59749..12092e4 100644
--- a/sys/geom/geom_event.c
+++ b/sys/geom/geom_event.c
@@ -255,7 +255,6 @@ g_post_event_x(g_event_t *func, void *arg, int flag, struct g_event **epp, va_li
g_trace(G_T_TOPOLOGY, " ref %p", p);
ep->ref[n++] = p;
}
- va_end(ap);
KASSERT(p == NULL, ("Too many references to event"));
ep->func = func;
ep->arg = arg;
@@ -273,11 +272,14 @@ int
g_post_event(g_event_t *func, void *arg, int flag, ...)
{
va_list ap;
+ int i;
- va_start(ap, flag);
KASSERT(flag == M_WAITOK || flag == M_NOWAIT,
("Wrong flag to g_post_event"));
- return (g_post_event_x(func, arg, flag, NULL, ap));
+ va_start(ap, flag);
+ i = g_post_event_x(func, arg, flag, NULL, ap);
+ va_end(ap);
+ return (i);
}
@@ -296,10 +298,11 @@ g_waitfor_event(g_event_t *func, void *arg, int flag, ...)
int error;
/* g_topology_assert_not(); */
- va_start(ap, flag);
KASSERT(flag == M_WAITOK || flag == M_NOWAIT,
("Wrong flag to g_post_event"));
+ va_start(ap, flag);
error = g_post_event_x(func, arg, flag | EV_WAKEUP, &ep, ap);
+ va_end(ap);
if (error)
return (error);
do
diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c
index 3b9db4e..9342f11 100644
--- a/sys/geom/geom_slice.c
+++ b/sys/geom/geom_slice.c
@@ -344,9 +344,10 @@ g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length
pp->mediasize = gsl->length;
return (0);
}
- va_start(ap, fmt);
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ va_start(ap, fmt);
sbuf_vprintf(sb, fmt, ap);
+ va_end(ap);
sbuf_finish(sb);
pp = g_new_providerf(gp, sbuf_data(sb));
pp2 = LIST_FIRST(&gp->consumer)->provider;
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index 84978c9..ec35f9e 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -203,9 +203,10 @@ g_new_geomf(struct g_class *mp, const char *fmt, ...)
struct sbuf *sb;
g_topology_assert();
- va_start(ap, fmt);
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ va_start(ap, fmt);
sbuf_vprintf(sb, fmt, ap);
+ va_end(ap);
sbuf_finish(sb);
gp = g_malloc(sizeof *gp, M_WAITOK | M_ZERO);
gp->protect = 0x020016601;
@@ -354,9 +355,10 @@ g_new_providerf(struct g_geom *gp, const char *fmt, ...)
va_list ap;
g_topology_assert();
- va_start(ap, fmt);
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
+ va_start(ap, fmt);
sbuf_vprintf(sb, fmt, ap);
+ va_end(ap);
sbuf_finish(sb);
pp = g_malloc(sizeof *pp + sbuf_len(sb) + 1, M_WAITOK | M_ZERO);
pp->protect = 0x020016603;
OpenPOWER on IntegriCloud