diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2008-12-10 08:07:22 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-12-29 07:40:06 -0500 |
commit | 3c387730ef2639811306c631e820711a70b98c5d (patch) | |
tree | a35ad902e603e28d7dd87deaaf94b5cc6d93f772 | |
parent | d61c72e52b98411d1cfef1fdb3f5a8bb070f8966 (diff) |
[libata] ata_piix: cleanup dmi strings checking
Commit
ATA: piix, fix pointer deref on suspend
fixed a possible oops in an ugly manner. Use newly introduced dmi_match()
to make the code pretty again.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alexandru Romanescu <a_romanescu@yahoo.co.uk>
Cc: Tejun Heo <tj@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/ata/ata_piix.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index c11936e13dd3..5fdf1678d0cc 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -1072,20 +1072,13 @@ static int piix_broken_suspend(void) | |||
1072 | * matching is necessary because dmi_system_id.matches is | 1072 | * matching is necessary because dmi_system_id.matches is |
1073 | * limited to four entries. | 1073 | * limited to four entries. |
1074 | */ | 1074 | */ |
1075 | if (dmi_get_system_info(DMI_SYS_VENDOR) && | 1075 | if (dmi_match(DMI_SYS_VENDOR, "TOSHIBA") && |
1076 | dmi_get_system_info(DMI_PRODUCT_NAME) && | 1076 | dmi_match(DMI_PRODUCT_NAME, "000000") && |
1077 | dmi_get_system_info(DMI_PRODUCT_VERSION) && | 1077 | dmi_match(DMI_PRODUCT_VERSION, "000000") && |
1078 | dmi_get_system_info(DMI_PRODUCT_SERIAL) && | 1078 | dmi_match(DMI_PRODUCT_SERIAL, "000000") && |
1079 | dmi_get_system_info(DMI_BOARD_VENDOR) && | 1079 | dmi_match(DMI_BOARD_VENDOR, "TOSHIBA") && |
1080 | dmi_get_system_info(DMI_BOARD_NAME) && | 1080 | dmi_match(DMI_BOARD_NAME, "Portable PC") && |
1081 | dmi_get_system_info(DMI_BOARD_VERSION) && | 1081 | dmi_match(DMI_BOARD_VERSION, "Version A0")) |
1082 | !strcmp(dmi_get_system_info(DMI_SYS_VENDOR), "TOSHIBA") && | ||
1083 | !strcmp(dmi_get_system_info(DMI_PRODUCT_NAME), "000000") && | ||
1084 | !strcmp(dmi_get_system_info(DMI_PRODUCT_VERSION), "000000") && | ||
1085 | !strcmp(dmi_get_system_info(DMI_PRODUCT_SERIAL), "000000") && | ||
1086 | !strcmp(dmi_get_system_info(DMI_BOARD_VENDOR), "TOSHIBA") && | ||
1087 | !strcmp(dmi_get_system_info(DMI_BOARD_NAME), "Portable PC") && | ||
1088 | !strcmp(dmi_get_system_info(DMI_BOARD_VERSION), "Version A0")) | ||
1089 | return 1; | 1082 | return 1; |
1090 | 1083 | ||
1091 | return 0; | 1084 | return 0; |