sb/intel/lynxpoint/pcie.c: Add more checks for NULL pointers
commit05b75241565ae91d0b8ee8b45eb2d8ac55291297
authorTristan Corrick <tristan@corrick.kiwi>
Thu, 6 Dec 2018 09:47:42 +0000 (6 22:47 +1300)
committerPatrick Georgi <pgeorgi@google.com>
Thu, 3 Jan 2019 18:10:48 +0000 (3 18:10 +0000)
tree4213618939857f48da995710490e9e447667979b
parent09a5323480fae9ad20075751cad9d1f25d61a3ab
sb/intel/lynxpoint/pcie.c: Add more checks for NULL pointers

If PCIe root port `n` is disabled, then `rpc.ports[n - 1]` remains NULL.
The existing Lynx Point systems probably don't end up dereferencing
NULL pointers this way. However, it might occur on a system using
Flexible I/O to remap PCIe root ports to other functions.

Tested on an ASRock H81M-HDS and an Acer C720 (Google Peppy). No issues
presented themselves.

Change-Id: I2c22fa36217766c2c4d6e8046f99989063066b16
Signed-off-by: Tristan Corrick <tristan@corrick.kiwi>
Reviewed-on: https://review.coreboot.org/c/30079
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
src/southbridge/intel/lynxpoint/pcie.c