diff options
author | smh <smh@FreeBSD.org> | 2015-11-12 09:45:35 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2015-11-12 09:45:35 +0000 |
commit | 6db964f7f3f304ee838d68d7666f4c098544087a (patch) | |
tree | ece9086326b5f41256263edfd963d3ea0b3463f4 /sys/dev/ixl | |
parent | 59e5487eeeb2bde82b50fb1a481a22969d2482f7 (diff) | |
download | FreeBSD-src-6db964f7f3f304ee838d68d7666f4c098544087a.zip FreeBSD-src-6db964f7f3f304ee838d68d7666f4c098544087a.tar.gz |
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
Diffstat (limited to 'sys/dev/ixl')
-rw-r--r-- | sys/dev/ixl/if_ixl.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 017ac7b..0428140 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); |