mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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:
parent
e49ce14150
commit
bafeafeab9
5 changed files with 8 additions and 5 deletions
|
@ -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, \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue