diff options
author | Ian Lepore <ian@FreeBSD.org> | 2015-03-15 17:39:38 +0000 |
---|---|---|
committer | Ian Lepore <ian@FreeBSD.org> | 2015-03-15 17:39:38 +0000 |
commit | 207e72288c8736b088b78c021a06e35b4a0ca5c0 (patch) | |
tree | ff9b19f25af4d038c348da8c5eae88ac85ace1e0 /sys/dev/ixl | |
parent | f2e62de7d99ae4061e72e313d3aa9779a15839a9 (diff) | |
download | src-207e72288c8736b088b78c021a06e35b4a0ca5c0.tar.gz src-207e72288c8736b088b78c021a06e35b4a0ca5c0.zip |
Remove redundant sysctl_handle_string() calls, the sbuf auto-drain takes
care of that.
Reviewed by: erj@
Notes
Notes:
svn path=/head/; revision=280043
Diffstat (limited to 'sys/dev/ixl')
-rwxr-xr-x | sys/dev/ixl/if_ixl.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index d26db6812b23..de4ee2450668 100755 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -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); |