From 9cc0d05612de6175ebef4db45cc25ab7f85c49da Mon Sep 17 00:00:00 2001 From: Steven Hartland Date: Thu, 12 Nov 2015 09:45:35 +0000 Subject: [PATCH] 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 --- sys/dev/ixl/if_ixl.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 017ac7beb39..04281400f17 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -5119,17 +5119,9 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS) } 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_ARGS) 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);