From owner-svn-src-all@FreeBSD.ORG Thu Dec 5 20:12:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA30B513; Thu, 5 Dec 2013 20:12:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C67251802; Thu, 5 Dec 2013 20:12:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB5KC2T1060526; Thu, 5 Dec 2013 20:12:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB5KC2Qa060524; Thu, 5 Dec 2013 20:12:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312052012.rB5KC2Qa060524@svn.freebsd.org> From: Alexander Motin Date: Thu, 5 Dec 2013 20:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259002 - stable/9/sys/dev/wbwd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Dec 2013 20:12:02 -0000 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);