diff options
author | Eddie James <eajames@linux.ibm.com> | 2023-01-26 15:08:09 -0600 |
---|---|---|
committer | Jarkko Sakkinen <jarkko@kernel.org> | 2023-02-13 10:11:20 +0200 |
commit | 441b7152729f4a2bdb100135a58625fa0aeb69e4 (patch) | |
tree | 7057c36aafa9fba9c1a645fbd7400782678aa4f8 /drivers/char/tpm/eventlog/of.c | |
parent | 40078327f6045185775eb7442a02f8edad2dea52 (diff) |
tpm: Use managed allocation for bios event log
Since the bios event log is freed in the device release function,
let devres handle the deallocation. This will allow other memory
allocation/mapping functions to be used for the bios event log.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'drivers/char/tpm/eventlog/of.c')
-rw-r--r-- | drivers/char/tpm/eventlog/of.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/tpm/eventlog/of.c b/drivers/char/tpm/eventlog/of.c index a9ce66d09a75..741ab2204b11 100644 --- a/drivers/char/tpm/eventlog/of.c +++ b/drivers/char/tpm/eventlog/of.c @@ -10,6 +10,7 @@ * Read the event log created by the firmware on PPC64 */ +#include <linux/device.h> #include <linux/slab.h> #include <linux/of.h> #include <linux/tpm_eventlog.h> @@ -65,7 +66,7 @@ int tpm_read_log_of(struct tpm_chip *chip) return -EIO; } - log->bios_event_log = kmemdup(__va(base), size, GFP_KERNEL); + log->bios_event_log = devm_kmemdup(&chip->dev, __va(base), size, GFP_KERNEL); if (!log->bios_event_log) return -ENOMEM; |