diff options
| -rw-r--r-- | sys/kern/uipc_sockbuf.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index d9f1ec8cce73..f34df449e36e 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -253,18 +253,14 @@ static int sysctl_handle_sb_max(SYSCTL_HANDLER_ARGS) { int error = 0; - u_long old_sb_max = sb_max; + u_long tmp_sb_max = sb_max; - error = SYSCTL_OUT(req, arg1, sizeof(u_long)); + error = sysctl_handle_long(oidp, &tmp_sb_max, arg2, req); if (error || !req->newptr) return (error); - error = SYSCTL_IN(req, arg1, sizeof(u_long)); - if (error) - return (error); - if (sb_max < MSIZE + MCLBYTES) { - sb_max = old_sb_max; + if (tmp_sb_max < MSIZE + MCLBYTES) return (EINVAL); - } + sb_max = tmp_sb_max; sb_max_adj = (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES); return (0); } |
