Remove redundant sysctl_handle_string() calls, the sbuf auto-drain takes

care of that.

Reviewed by:	erj@
This commit is contained in:
Ian Lepore 2015-03-15 17:39:38 +00:00
parent f2e62de7d9
commit 207e72288c

View File

@ -4994,7 +4994,7 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS)
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);
@ -5038,13 +5038,7 @@ 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;
}
@ -5102,7 +5096,7 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS)
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);
@ -5121,6 +5115,7 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS)
nmbuf = sbuf_new_auto();
if (!nmbuf) {
device_printf(dev, "Could not allocate sbuf for name output.\n");
sbuf_delete(buf);
return (ENOMEM);
}
@ -5155,13 +5150,7 @@ ixl_sysctl_switch_config(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);