aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/asus_acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/asus_acpi.c')
-rw-r--r--drivers/acpi/asus_acpi.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index fec895af6ae6..582995ef9f34 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -987,9 +987,21 @@ static int __init asus_hotk_get_info(void)
987 printk(KERN_NOTICE " BSTS called, 0x%02x returned\n", 987 printk(KERN_NOTICE " BSTS called, 0x%02x returned\n",
988 bsts_result); 988 bsts_result);
989 989
990 /* Samsung P30 has a device with a valid _HID whose INIT does not 990 /* This is unlikely with implicit return */
991 * return anything. Catch this one and any similar here */ 991 if (buffer.pointer == NULL)
992 if (buffer.pointer == NULL) { 992 return -EINVAL;
993
994 model = (union acpi_object *) buffer.pointer;
995 /*
996 * Samsung P30 has a device with a valid _HID whose INIT does not
997 * return anything. It used to be possible to catch this exception,
998 * but the implicit return code will now happily confuse the
999 * driver. We assume that every ACPI_TYPE_STRING is a valid model
1000 * identifier but it's still possible to get completely bogus data.
1001 */
1002 if (model->type == ACPI_TYPE_STRING) {
1003 printk(KERN_NOTICE " %s model detected, ", model->string.pointer);
1004 } else {
993 if (asus_info && /* Samsung P30 */ 1005 if (asus_info && /* Samsung P30 */
994 strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) { 1006 strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) {
995 hotk->model = P30; 1007 hotk->model = P30;
@@ -1002,13 +1014,10 @@ static int __init asus_hotk_get_info(void)
1002 "the developers with your DSDT\n"); 1014 "the developers with your DSDT\n");
1003 } 1015 }
1004 hotk->methods = &model_conf[hotk->model]; 1016 hotk->methods = &model_conf[hotk->model];
1005 return AE_OK; 1017
1006 } 1018 acpi_os_free(model);
1007 1019
1008 model = (union acpi_object *)buffer.pointer; 1020 return AE_OK;
1009 if (model->type == ACPI_TYPE_STRING) {
1010 printk(KERN_NOTICE " %s model detected, ",
1011 model->string.pointer);
1012 } 1021 }
1013 1022
1014 hotk->model = END_MODEL; 1023 hotk->model = END_MODEL;