hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/char/tpm/tpm_tis.c
....@@ -83,6 +83,22 @@
8383 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T490s"),
8484 },
8585 },
86
+ {
87
+ .callback = tpm_tis_disable_irq,
88
+ .ident = "ThinkStation P360 Tiny",
89
+ .matches = {
90
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
91
+ DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkStation P360 Tiny"),
92
+ },
93
+ },
94
+ {
95
+ .callback = tpm_tis_disable_irq,
96
+ .ident = "ThinkPad L490",
97
+ .matches = {
98
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
99
+ DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L490"),
100
+ },
101
+ },
86102 {}
87103 };
88104
....@@ -125,6 +141,7 @@
125141 const struct acpi_device_id *aid = acpi_match_device(tpm_acpi_tbl, dev);
126142 struct acpi_table_tpm2 *tbl;
127143 acpi_status st;
144
+ int ret = 0;
128145
129146 if (!aid || aid->driver_data != DEVICE_IS_TPM2)
130147 return 0;
....@@ -132,8 +149,7 @@
132149 /* If the ACPI TPM2 signature is matched then a global ACPI_SIG_TPM2
133150 * table is mandatory
134151 */
135
- st =
136
- acpi_get_table(ACPI_SIG_TPM2, 1, (struct acpi_table_header **)&tbl);
152
+ st = acpi_get_table(ACPI_SIG_TPM2, 1, (struct acpi_table_header **)&tbl);
137153 if (ACPI_FAILURE(st) || tbl->header.length < sizeof(*tbl)) {
138154 dev_err(dev, FW_BUG "failed to get TPM2 ACPI table\n");
139155 return -EINVAL;
....@@ -141,9 +157,10 @@
141157
142158 /* The tpm2_crb driver handles this device */
143159 if (tbl->start_method != ACPI_TPM2_MEMORY_MAPPED)
144
- return -ENODEV;
160
+ ret = -ENODEV;
145161
146
- return 0;
162
+ acpi_put_table((struct acpi_table_header *)tbl);
163
+ return ret;
147164 }
148165 #else
149166 static int check_acpi_tpm2(struct device *dev)