]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] kernel/param.c: don't use .max when .num is NULL in param_array_set()
authorBert Wesarg <wesarg@informatik.uni-halle.de>
Sat, 16 Apr 2005 22:25:42 +0000 (15:25 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 16 Apr 2005 22:25:42 +0000 (15:25 -0700)
commitbcc72f4ffcf2fde58796f49979c170105443c9c7
tree3d252b619661e38e05c8f7e95dbcd386b828c639
parentaf3dd8fab9deb4e6a3ad060c6b55fdfc29252f91
[PATCH] kernel/param.c: don't use .max when .num is NULL in param_array_set()

there seems to be a bug, at least for me, in kernel/param.c for arrays with
.num == NULL.  If .num == NULL, the function param_array_set() uses &.max
for the call to param_array(), wich alters the .max value to the number of
arguments.  The result is, you can't set more array arguments as the last
time you set the parameter.

example:

# a module 'example' with
# static int array[10] = { 0, };
# module_param_array(array, int, NULL, 0644);

$ insmod example.ko array=1,2,3
$ cat /sys/module/example/parameters/array
1,2,3
$ echo "4,3,2,1" > /sys/module/example/parameters/array
$ dmesg | tail -n 1
kernel: array: can take only 3 arguments

Signed-off-by: Bert Wesarg <wesarg@informatik.uni-halle.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/params.c