summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-01-13 09:32:16 +1030
committerRusty Russell <rusty@rustcorp.com.au>2012-01-13 09:32:16 +1030
commitbafeafeab94b8d3019aac15c2df2ce47b08a6363 (patch)
treec121e82aee4f0969cf90dfb2dbad46d06a669696 /include/linux
parente49ce14150c64b29a8dd211df785576fa19a9858 (diff)
module_param: check type correctness for module_param_array
module_param_array(), unlike its non-array cousins, didn't check the type of the variable. Fixing this found two bugs. Cc: Luca Risolia <luca.risolia@studio.unibo.it> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Eric Piel <eric.piel@tremplin-utc.net> Cc: linux-media@vger.kernel.org Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/moduleparam.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 7939f636c8b..794d4b0f121 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -395,6 +395,7 @@ extern int param_get_invbool(char *buffer, const struct kernel_param *kp);
* module_param_named() for why this might be necessary.
*/
#define module_param_array_named(name, array, type, nump, perm) \
+ param_check_##type(name, &(array)[0]); \
static const struct kparam_array __param_arr_##name \
= { .max = ARRAY_SIZE(array), .num = nump, \
.ops = &param_ops_##type, \