mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: util/intelmetool: Fix segfault on edge cases
The intel ME checker tool would segfault if it reaches the end of
the loop without having the dev pointer set. This happens when
it gets to the end of the previous loop without knowing what to do
with any of the devices it sees.
This patch makes sure the pointer is not NULL before accessing it.
BUG=none
BRANCH=none
TEST=none
Change-Id: Ibaef27c8be18b6704d60250098a6f676fe197965
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 2a1ae05316
Original-Change-Id: Ia13191799d7e00185947f9df5188cb2666c43e2a
Original-Signed-off-by: Huan Truong <htruong@tnhh.net>
Original-Reviewed-on: https://review.coreboot.org/18573
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Original-Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://chromium-review.googlesource.com/451435
This commit is contained in:
parent
fa491907a8
commit
79c854db96
1 changed files with 2 additions and 1 deletions
|
@ -137,7 +137,8 @@ static int pci_platform_scan() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!PCI_DEV_HAS_ME_DISABLE(dev->device_id) &&
|
||||
if (dev != NULL &&
|
||||
!PCI_DEV_HAS_ME_DISABLE(dev->device_id) &&
|
||||
!PCI_DEV_HAS_ME_DIFFICULT(dev->device_id) &&
|
||||
!PCI_DEV_CAN_DISABLE_ME_IF_PRESENT(dev->device_id) &&
|
||||
!PCI_DEV_ME_NOT_SURE(dev->device_id)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue