sysctl.c (f613d86d014b6375a4085901de39406598121e35) sysctl.c (2d3b559df3ed39258737789aae2ae7973d205bc1)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * sysctl.c: General linux system control interface
4 *
5 * Begun 24 March 1995, Stephen Tweedie
6 * Added /proc support, Dec 1995
7 * Added bdflush entry and intvec min/max checking, 2/23/96, Tom Dyas.
8 * Added hooks for /proc/sys/net (minor, minor patch), 96/4/1, Mike Shaver.

--- 909 unchanged lines hidden (view full) ---

918 if (ret)
919 return ret;
920
921 if (write) {
922 if ((param->min && *param->min > tmp) ||
923 (param->max && *param->max < tmp))
924 return -ERANGE;
925
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * sysctl.c: General linux system control interface
4 *
5 * Begun 24 March 1995, Stephen Tweedie
6 * Added /proc support, Dec 1995
7 * Added bdflush entry and intvec min/max checking, 2/23/96, Tom Dyas.
8 * Added hooks for /proc/sys/net (minor, minor patch), 96/4/1, Mike Shaver.

--- 909 unchanged lines hidden (view full) ---

918 if (ret)
919 return ret;
920
921 if (write) {
922 if ((param->min && *param->min > tmp) ||
923 (param->max && *param->max < tmp))
924 return -ERANGE;
925
926 *valp = tmp;
926 WRITE_ONCE(*valp, tmp);
927 }
928
929 return 0;
930}
931
932/**
933 * proc_douintvec_minmax - read a vector of unsigned ints with min/max values
934 * @table: the sysctl table

--- 1528 unchanged lines hidden ---
927 }
928
929 return 0;
930}
931
932/**
933 * proc_douintvec_minmax - read a vector of unsigned ints with min/max values
934 * @table: the sysctl table

--- 1528 unchanged lines hidden ---