[coreboot-gerrit] Change in coreboot[master]: soc/amd/stoneyridge: Check UART index

Marshall Dawson (Code Review) gerrit at coreboot.org
Fri Aug 18 18:14:19 CEST 2017


Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/21096


Change subject: soc/amd/stoneyridge: Check UART index
......................................................................

soc/amd/stoneyridge: Check UART index

Verify that the caller to uart_platform_base() sends a valid index.
The Stoney Ridge APU has only two internal UARTs.

Change-Id: I9432571712bae15a604f4280ea5e0f81fd68604d
Signed-off-by: Marshall Dawson <marshalldawson3rd at gmail.com>
---
M src/soc/amd/stoneyridge/uart.c
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/21096/1

diff --git a/src/soc/amd/stoneyridge/uart.c b/src/soc/amd/stoneyridge/uart.c
index 9cc0c94..016d77b 100644
--- a/src/soc/amd/stoneyridge/uart.c
+++ b/src/soc/amd/stoneyridge/uart.c
@@ -13,11 +13,13 @@
  * GNU General Public License for more details.
  */
 
+#include <assert.h>
 #include <console/uart.h>
 #include <soc/southbridge.h>
 
 uintptr_t uart_platform_base(int idx)
 {
+	assert(idx <= 1 && idx >= 0);
 	return (uintptr_t)(APU_UART0_BASE + 0x2000 * (idx & 1));
 }
 

-- 
To view, visit https://review.coreboot.org/21096
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9432571712bae15a604f4280ea5e0f81fd68604d
Gerrit-Change-Number: 21096
Gerrit-PatchSet: 1
Gerrit-Owner: Marshall Dawson <marshalldawson3rd at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170818/abbc229e/attachment-0001.html>


More information about the coreboot-gerrit mailing list