From owner-svn-src-all@freebsd.org Fri Dec 11 12:58:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C07F9D85EA; Fri, 11 Dec 2015 12:58:21 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F17C61F5A; Fri, 11 Dec 2015 12:58:20 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBCwKL9056418; Fri, 11 Dec 2015 12:58:20 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBCwKWv056417; Fri, 11 Dec 2015 12:58:20 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512111258.tBBCwKWv056417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 11 Dec 2015 12:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292098 - stable/10/sys/dev/ixl X-SVN-Group: stable-10 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.20 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: Fri, 11 Dec 2015 12:58:21 -0000 Author: smh Date: Fri Dec 11 12:58:19 2015 New Revision: 292098 URL: https://svnweb.freebsd.org/changeset/base/292098 Log: MFC r280043: Remove redundant sysctl_handle_string Sponsored by: Multiplay Modified: stable/10/sys/dev/ixl/if_ixl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:47:49 2015 (r292097) +++ stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:58:19 2015 (r292098) @@ -4989,7 +4989,7 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A u8 num_entries; struct i40e_aqc_switch_resource_alloc_element_resp resp[IXL_SW_RES_SIZE]; - buf = sbuf_new_for_sysctl(NULL, NULL, 0, req); + buf = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (!buf) { device_printf(dev, "Could not allocate sbuf for output.\n"); return (ENOMEM); @@ -5031,6 +5031,9 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A } error = sbuf_finish(buf); + if (error) { + device_printf(dev, "Error finishing sbuf: %d\n", error); + } sbuf_delete(buf); return (error); @@ -5089,7 +5092,7 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ struct i40e_aqc_get_switch_config_resp *sw_config; sw_config = (struct i40e_aqc_get_switch_config_resp *)aq_buf; - buf = sbuf_new_for_sysctl(NULL, NULL, 0, req); + buf = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (!buf) { device_printf(dev, "Could not allocate sbuf for sysctl output.\n"); return (ENOMEM); @@ -5108,6 +5111,7 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ nmbuf = sbuf_new_auto(); if (!nmbuf) { device_printf(dev, "Could not allocate sbuf for name output.\n"); + sbuf_delete(buf); return (ENOMEM); } @@ -5140,6 +5144,9 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ sbuf_delete(nmbuf); error = sbuf_finish(buf); + if (error) { + device_printf(dev, "Error finishing sbuf: %d\n", error); + } sbuf_delete(buf); return (error);