[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191215182314.32208-1-pakki001@umn.edu>
Date: Sun, 15 Dec 2019 12:23:14 -0600
From: Aditya Pakki <pakki001@....edu>
To: pakki001@....edu
Cc: kjlu@....edu, Peter Huewe <peterhuewe@....de>,
Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
Jason Gunthorpe <jgg@...pe.ca>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] tpm/ppi: replace assertion code with recovery in tpm_eval_dsm
In tpm_eval_dsm, BUG_ON on ppi_handle is used as an assertion.
By returning NULL to the callers, instead of crashing, the error
can be better handled.
Signed-off-by: Aditya Pakki <pakki001@....edu>
---
drivers/char/tpm/tpm_ppi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c
index b2dab941cb7f..4b6f6a9c0b48 100644
--- a/drivers/char/tpm/tpm_ppi.c
+++ b/drivers/char/tpm/tpm_ppi.c
@@ -42,7 +42,9 @@ static inline union acpi_object *
tpm_eval_dsm(acpi_handle ppi_handle, int func, acpi_object_type type,
union acpi_object *argv4, u64 rev)
{
- BUG_ON(!ppi_handle);
+ if (!ppi_handle)
+ return NULL;
+
return acpi_evaluate_dsm_typed(ppi_handle, &tpm_ppi_guid,
rev, func, argv4, type);
}
--
2.20.1
Powered by blists - more mailing lists