Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Dec 2015 12:58:20 +0000 (UTC)
From:      Steven Hartland <smh@FreeBSD.org>
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
Message-ID:  <201512111258.tBBCwKWv056417@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512111258.tBBCwKWv056417>