Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Nov 2015 09:45:35 +0000 (UTC)
From:      Steven Hartland <smh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r290708 - head/sys/dev/ixl
Message-ID:  <201511120945.tAC9jZZk067057@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: smh
Date: Thu Nov 12 09:45:35 2015
New Revision: 290708
URL: https://svnweb.freebsd.org/changeset/base/290708

Log:
  Fix ixl debug sysctls panic
  
  Remove the use of sbuf_data on drained sbufs from the debug sysctls:
  * ixl_sysctl_hw_res_alloc
  * ixl_sysctl_switch_config
  
  This prevents a kernel panic when accessing these values under a kernel
  compiled with INVARIANTS.
  
  Sponsored by:	Multiplay

Modified:
  head/sys/dev/ixl/if_ixl.c

Modified: head/sys/dev/ixl/if_ixl.c
==============================================================================
--- head/sys/dev/ixl/if_ixl.c	Thu Nov 12 09:20:10 2015	(r290707)
+++ head/sys/dev/ixl/if_ixl.c	Thu Nov 12 09:45:35 2015	(r290708)
@@ -5119,17 +5119,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;
-	}
-
-	error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), req);
-	if (error)
-		device_printf(dev, "sysctl error: %d\n", error);
 	sbuf_delete(buf);
-	return error;
+
+	return (error);
 }
 
 /*
@@ -5236,15 +5228,6 @@ 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;
-	}
-
-	error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), req);
-	if (error)
-		device_printf(dev, "sysctl error: %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?201511120945.tAC9jZZk067057>