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>
This commit is contained in:
@@ -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, \
|
||||
|
Reference in New Issue
Block a user