[coreboot-gerrit] New patch to review for coreboot: intel/skylake/pcr.c: error out on invalid size in pcr read/write

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Wed Jan 13 19:54:30 CET 2016


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12936

-gerrit

commit 433d13df5c5e7f850fc0f78251a3e5112bee4e8c
Author: Martin Roth <martinroth at google.com>
Date:   Wed Jan 13 11:54:18 2016 -0700

    intel/skylake/pcr.c: error out on invalid size in pcr read/write
    
    The read and write routines take a number of bytes to write, which
    should be 1,2, or 4.  We now return an error if an invalid size
    is specified.
    
    Change-Id: I93344bc0837c3715fc7660503f405c8878eb711c
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 src/soc/intel/skylake/pcr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/soc/intel/skylake/pcr.c b/src/soc/intel/skylake/pcr.c
index 7efbb25..b6de73c 100644
--- a/src/soc/intel/skylake/pcr.c
+++ b/src/soc/intel/skylake/pcr.c
@@ -63,7 +63,7 @@ static int pch_pcr_read(u8 pid, u16 offset, u32 size, void *data)
 		*(u8 *) data = read8(pcr_reg_address(pid, offset));
 		break;
 	default:
-		break;
+		return -1;
 	}
 	return 0;
 }
@@ -123,7 +123,7 @@ static int pch_pcr_write(u8 pid, u16 offset, u32 size, u32 data)
 		write8(pcr_reg_address(pid, offset), (u8) data);
 		break;
 	default:
-		break;
+		return -1;
 	}
 	/* Ensure the writes complete. */
 	complete_write();



More information about the coreboot-gerrit mailing list