svn commit: r259002 - stable/9/sys/dev/wbwd

Alexander Motin mav at FreeBSD.org
Thu Dec 5 20:12:02 UTC 2013


Author: mav
Date: Thu Dec  5 20:12:02 2013
New Revision: 259002
URL: http://svnweb.freebsd.org/changeset/base/259002

Log:
  MFC r244280 (by pjd):
  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.

Modified:
  stable/9/sys/dev/wbwd/wbwd.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/wbwd/wbwd.c
==============================================================================
--- stable/9/sys/dev/wbwd/wbwd.c	Thu Dec  5 18:39:03 2013	(r259001)
+++ stable/9/sys/dev/wbwd/wbwd.c	Thu Dec  5 20:12:02 2013	(r259002)
@@ -250,9 +250,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-stable-9 mailing list