aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/moduleparam.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-01-12 18:02:16 -0500
committerRusty Russell <rusty@rustcorp.com.au>2012-01-12 18:02:16 -0500
commitbafeafeab94b8d3019aac15c2df2ce47b08a6363 (patch)
treec121e82aee4f0969cf90dfb2dbad46d06a669696 /include/linux/moduleparam.h
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/moduleparam.h')
-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 7939f636c8ba..794d4b0f1215 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);
395 * module_param_named() for why this might be necessary. 395 * module_param_named() for why this might be necessary.
396 */ 396 */
397#define module_param_array_named(name, array, type, nump, perm) \ 397#define module_param_array_named(name, array, type, nump, perm) \
398 param_check_##type(name, &(array)[0]); \
398 static const struct kparam_array __param_arr_##name \ 399 static const struct kparam_array __param_arr_##name \
399 = { .max = ARRAY_SIZE(array), .num = nump, \ 400 = { .max = ARRAY_SIZE(array), .num = nump, \
400 .ops = &param_ops_##type, \ 401 .ops = &param_ops_##type, \