freebsd-nq/sys/dev/wbwd
Pawel Jakub Dawidek 03385af198 sbuf_trim() cannot be used on sbuf with drain function set.
This fixes panic when listing sysctls on INVARIANTS-enabled kernel while
having wbwd loaded.

This panic was not fatal, at worst one additional space was printed.

Also sbuf_trim() makes some sense even if drain function is set. The drain
function is called only when buffer is to be expanded. So we could still trim
existing buffer before drain is called. In this case it worked just fine - the
trailing space was correctly trimmed.

Obtained from:	WHEEL Systems
MFC after:	1 week
2012-12-15 22:26:16 +00:00
..
wbwd.c sbuf_trim() cannot be used on sbuf with drain function set. 2012-12-15 22:26:16 +00:00