svn commit: r244280 - head/sys/dev/wbwd

Pawel Jakub Dawidek pjd at FreeBSD.org
Sat Dec 15 22:26:17 UTC 2012


Author: pjd
Date: Sat Dec 15 22:26:16 2012
New Revision: 244280
URL: http://svnweb.freebsd.org/changeset/base/244280

Log:
  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

Modified:
  head/sys/dev/wbwd/wbwd.c

Modified: head/sys/dev/wbwd/wbwd.c
==============================================================================
--- head/sys/dev/wbwd/wbwd.c	Sat Dec 15 21:57:34 2012	(r244279)
+++ head/sys/dev/wbwd/wbwd.c	Sat Dec 15 22:26:16 2012	(r244280)
@@ -208,9 +208,8 @@ sysctl_wb_debug(SYSCTL_HANDLER_ARGS)
 	sbuf_printf(&sb, "LDN8 (GPIO2, Watchdog): ");
 	sbuf_printf(&sb, "CRF5 0x%02x ", sc->reg_1);
 	sbuf_printf(&sb, "CRF6 0x%02x ", sc->reg_timeout);
-	sbuf_printf(&sb, "CRF7 0x%02x ", sc->reg_2);
+	sbuf_printf(&sb, "CRF7 0x%02x", sc->reg_2);
 
-	sbuf_trim(&sb);
 	error = sbuf_finish(&sb);
 	sbuf_delete(&sb);
 	return (error);


More information about the svn-src-head mailing list