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
This commit is contained in:
Steven Hartland 2015-11-12 09:45:35 +00:00
parent e72a4bdeb2
commit 9cc0d05612

View File

@ -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);