cxgbe(4): Do not call sbuf_trim on an sbuf with a drain function.

MFC after:	1 week
This commit is contained in:
np 2015-03-23 23:06:32 +00:00
parent 22da00a29e
commit 265b7b076b

View File

@ -5080,13 +5080,16 @@ cxgbe_sysctls(struct port_info *pi)
static int
sysctl_int_array(SYSCTL_HANDLER_ARGS)
{
int rc, *i;
int rc, *i, space = 0;
struct sbuf sb;
sbuf_new_for_sysctl(&sb, NULL, 64, req);
for (i = arg1; arg2; arg2 -= sizeof(int), i++)
sbuf_printf(&sb, "%d ", *i);
sbuf_trim(&sb);
for (i = arg1; arg2; arg2 -= sizeof(int), i++) {
if (space)
sbuf_printf(&sb, " ");
sbuf_printf(&sb, "%d", *i);
space = 1;
}
rc = sbuf_finish(&sb);
sbuf_delete(&sb);
return (rc);