diff options
Diffstat (limited to 'drivers/misc/thinkpad_acpi.c')
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 8c9430775285..ab23a3221585 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -4817,9 +4817,15 @@ static int __init set_ibm_param(const char *val, struct kernel_param *kp) | |||
4817 | unsigned int i; | 4817 | unsigned int i; |
4818 | struct ibm_struct *ibm; | 4818 | struct ibm_struct *ibm; |
4819 | 4819 | ||
4820 | if (!kp || !kp->name || !val) | ||
4821 | return -EINVAL; | ||
4822 | |||
4820 | for (i = 0; i < ARRAY_SIZE(ibms_init); i++) { | 4823 | for (i = 0; i < ARRAY_SIZE(ibms_init); i++) { |
4821 | ibm = ibms_init[i].data; | 4824 | ibm = ibms_init[i].data; |
4822 | BUG_ON(ibm == NULL); | 4825 | WARN_ON(ibm == NULL); |
4826 | |||
4827 | if (!ibm || !ibm->name) | ||
4828 | continue; | ||
4823 | 4829 | ||
4824 | if (strcmp(ibm->name, kp->name) == 0 && ibm->write) { | 4830 | if (strcmp(ibm->name, kp->name) == 0 && ibm->write) { |
4825 | if (strlen(val) > sizeof(ibms_init[i].param) - 2) | 4831 | if (strlen(val) > sizeof(ibms_init[i].param) - 2) |