[coreboot-gerrit] Change in coreboot[master]: libpayload-x86: i8042: fix i8042_data_ready_ps2 and i8042_data_ready_aux

Hannah Williams (Code Review) gerrit at coreboot.org
Sun May 27 18:35:27 CEST 2018


Hannah Williams has uploaded this change for review. ( https://review.coreboot.org/26590


Change subject: libpayload-x86: i8042: fix i8042_data_ready_ps2 and i8042_data_ready_aux
......................................................................

libpayload-x86: i8042: fix i8042_data_ready_ps2 and i8042_data_ready_aux

keyboard_disconnect was called without keyboard_init being called and in this
case keyboard_havechar returns true because i8042_data_ready_ps2 is
dereferencing uninitialized variable ps2_fifo from within fifo_is_empty causing
keyboard_disconnect to be stuck in this while loop.
while (keyboard_havechar())
    keyboard_getchar();

BUG=b:80299098
TEST=Check if the normal mode path in depthcharge is not causing a hang

Change-Id: I944b4836005c887a2715717dff2df1b5a220818e
Signed-off-by: Hannah Williams <hannah.williams at intel.com>
---
M payloads/libpayload/drivers/i8042/i8042.c
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/26590/1

diff --git a/payloads/libpayload/drivers/i8042/i8042.c b/payloads/libpayload/drivers/i8042/i8042.c
index 1bf1855..6eb618a 100644
--- a/payloads/libpayload/drivers/i8042/i8042.c
+++ b/payloads/libpayload/drivers/i8042/i8042.c
@@ -332,6 +332,8 @@
  */
 u8 i8042_data_ready_ps2(void)
 {
+	if (!initialized)
+		return 0;
 	i8042_data_poll();
 	return !fifo_is_empty(ps2_fifo);
 }
@@ -341,6 +343,8 @@
  */
 u8 i8042_data_ready_aux(void)
 {
+	if (!initialized)
+		return 0;
 	i8042_data_poll();
 	return !fifo_is_empty(aux_fifo);
 }

-- 
To view, visit https://review.coreboot.org/26590
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I944b4836005c887a2715717dff2df1b5a220818e
Gerrit-Change-Number: 26590
Gerrit-PatchSet: 1
Gerrit-Owner: Hannah Williams <hannah.williams at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180527/71dd9a83/attachment-0001.html>


More information about the coreboot-gerrit mailing list