From bafeafeab94b8d3019aac15c2df2ce47b08a6363 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 13 Jan 2012 09:32:16 +1030 Subject: 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 Cc: Mauro Carvalho Chehab Cc: Eric Piel Cc: linux-media@vger.kernel.org Signed-off-by: Rusty Russell --- include/linux/moduleparam.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/moduleparam.h') 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); * 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 = ¶m_ops_##type, \ -- cgit v1.2.1