build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/23766 )
Change subject: libpayload: usbhid: Zero-initialize all parts of usbhid instance struct
......................................................................
Patch Set 1: Verified+1
Build Successful
https://qa.coreboot.org/job/coreboot-gerrit/67501/ : SUCCESS
https://qa.coreboot.org/job/coreboot-checkpatch/22034/ : SUCCESS
--
To view, visit https://review.coreboot.org/23766
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic987de2daaceaad2ae401a1e12b1bee397f802ee
Gerrit-Change-Number: 23766
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Thu, 15 Feb 2018 00:57:16 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
Hello Nico Huber, Patrick Georgi,
I'd like you to do a code review. Please visit
https://review.coreboot.org/23766
to review the following change.
Change subject: libpayload: usbhid: Zero-initialize all parts of usbhid instance struct
......................................................................
libpayload: usbhid: Zero-initialize all parts of usbhid instance struct
The USBHID driver zero-initializes some but not all of the fields in its
usbhid_inst_t structure. This is a problem because under some
circumstances, some of the uninitialized fields may be read and lead to
incorrect behavior. Some (broken) USB keyboards keep sending reports
that contain all zeroes even when they have no new keys... these usually
get silently ignored, but if the usbhid_inst_t structure is in an
inconsistent state where 'previous' is zeroed out but 'lastkeypress'
is non-zero because it wasn't properly initialized, these reports will
be interpreted as keyrepeats of the bogus 'lastkeypress'. This patch
changes the code to just xzalloc() the whole structure so we won't have
to worry about initialization issues anymore.
Change-Id: Ic987de2daaceaad2ae401a1e12b1bee397f802ee
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
---
M payloads/libpayload/drivers/usb/usbhid.c
1 file changed, 1 insertion(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/66/23766/1
diff --git a/payloads/libpayload/drivers/usb/usbhid.c b/payloads/libpayload/drivers/usb/usbhid.c
index 3100d37..68130f8 100644
--- a/payloads/libpayload/drivers/usb/usbhid.c
+++ b/payloads/libpayload/drivers/usb/usbhid.c
@@ -439,11 +439,7 @@
boot_protos[interface->bInterfaceProtocol]);
switch (interface->bInterfaceProtocol) {
case hid_boot_proto_keyboard:
- dev->data = malloc (sizeof (usbhid_inst_t));
- if (!dev->data)
- fatal("Not enough memory for USB HID device.\n");
- memset(&HID_INST(dev)->previous, 0x00,
- sizeof(HID_INST(dev)->previous));
+ dev->data = xzalloc (sizeof (usbhid_inst_t));
usb_debug (" configuring...\n");
usb_hid_set_protocol(dev, interface, hid_proto_boot);
usb_hid_set_idle(dev, interface, KEYBOARD_REPEAT_MS);
--
To view, visit https://review.coreboot.org/23766
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: Ic987de2daaceaad2ae401a1e12b1bee397f802ee
Gerrit-Change-Number: 23766
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/23746 )
Change subject: mb/google/fizz: Wait until display is ready
......................................................................
Patch Set 3:
Build Successful
https://qa.coreboot.org/job/coreboot-gerrit/67499/ : SUCCESS
--
To view, visit https://review.coreboot.org/23746
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I90befe94f93e13904987acda50b2598d034b0031
Gerrit-Change-Number: 23746
Gerrit-PatchSet: 3
Gerrit-Owner: Daisuke Nojiri <dnojiri(a)chromium.org>
Gerrit-Reviewer: Daisuke Nojiri <dnojiri(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Sumeet R Pawnikar <sumeet.r.pawnikar(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Thu, 15 Feb 2018 00:00:13 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No