Add missing va_end() calls.
Noticed by: tmm
This commit is contained in:
parent
246300f212
commit
a1a9b44569
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115949
@ -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));
|
||||
|
@ -270,6 +270,7 @@ g_trace(int level, const char *fmt, ...)
|
||||
return;
|
||||
va_start(ap, fmt);
|
||||
vprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user