summaryrefslogtreecommitdiff
path: root/src/mainboard/google/octopus/mainboard.c
diff options
context:
space:
mode:
authorJohn Zhao <john.zhao@intel.com>2018-08-20 10:27:39 -0700
committerPatrick Georgi <pgeorgi@google.com>2018-08-23 14:36:20 +0000
commita2c0cf5dfe4c2666cf4302c58360c45819b1f769 (patch)
tree45000b11cca903d350727a896cc86fc952c68580 /src/mainboard/google/octopus/mainboard.c
parentc5ee35ff861fe4447fd80119f645fba7bfd3a184 (diff)
mb/google/octopus: Add null pointer check
src/mainboard/google/octopus/mainboard.c Function dev_find_slot may return NULL, check before its usage. Found-by: klockwork BRANCH=None TEST=Built & booted Yorp board. Change-Id: I160adbe3b0a5a2b0f11fd1567513860664d4bee3 Signed-off-by: John Zhao <john.zhao@intel.com> Reviewed-on: https://review.coreboot.org/28235 Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/octopus/mainboard.c')
-rw-r--r--src/mainboard/google/octopus/mainboard.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mainboard/google/octopus/mainboard.c b/src/mainboard/google/octopus/mainboard.c
index 61d254ee5a..6effa7c080 100644
--- a/src/mainboard/google/octopus/mainboard.c
+++ b/src/mainboard/google/octopus/mainboard.c
@@ -169,7 +169,8 @@ static void wifi_device_update(void)
devfn = PCH_DEVFN_PCIE1;
dev = dev_find_slot(0, devfn);
- dev->enabled = 0;
+ if (dev)
+ dev->enabled = 0;
}
void mainboard_devtree_update(struct device *dev)