From 31ee3a33aa612294db302828d4d1f6f0c83bef4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Sewi=C5=82=C5=82o-Jopek?= Date: Tue, 16 Aug 2022 09:27:36 +0200 Subject: [PATCH] TPM: do not set device description if probe fails device_set_desc should be called only if driver probes successfully. Approved by: mw(mentor) Reviewed by: mw, kd MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35998 --- sys/dev/tpm/tpm_crb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/tpm/tpm_crb.c b/sys/dev/tpm/tpm_crb.c index 5b9619ee9b2..e18201c58a7 100644 --- a/sys/dev/tpm/tpm_crb.c +++ b/sys/dev/tpm/tpm_crb.c @@ -114,7 +114,7 @@ tpmcrb_acpi_probe(device_t dev) status = AcpiGetTable(ACPI_SIG_TPM2, 1, (ACPI_TABLE_HEADER **) &tbl); if(ACPI_FAILURE(status) || tbl->StartMethod != TPM2_START_METHOD_CRB) - err = ENXIO; + return (ENXIO); device_set_desc(dev, "Trusted Platform Module 2.0, CRB mode"); return (err);