Skip to content

Commit 8dc9c07

Browse files
ColinIanKingjarkkojs
authored andcommitted
tpm: remove kmalloc failure error message
The kmalloc failure message is just noise. Remove it and replace -EFAULT with -ENOMEM as standard for out of memory allocation error returns. Link: https://lore.kernel.org/linux-integrity/[email protected]/ Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 3d0ebc3 commit 8dc9c07

File tree

1 file changed

+2
-5
lines changed
  • drivers/char/tpm/eventlog

1 file changed

+2
-5
lines changed

drivers/char/tpm/eventlog/tpm1.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,8 @@ static int tpm1_ascii_bios_measurements_show(struct seq_file *m, void *v)
257257
(unsigned char *)(v + sizeof(struct tcpa_event));
258258

259259
eventname = kmalloc(MAX_TEXT_EVENT, GFP_KERNEL);
260-
if (!eventname) {
261-
printk(KERN_ERR "%s: ERROR - No Memory for event name\n ",
262-
__func__);
263-
return -EFAULT;
264-
}
260+
if (!eventname)
261+
return -ENOMEM;
265262

266263
/* 1st: PCR */
267264
seq_printf(m, "%2d ", do_endian_conversion(event->pcr_index));

0 commit comments

Comments
 (0)