Attention is currently required from: Furquan Shaikh, Maulik V Vaghela, Tim Wawrzynczak. Hello Furquan Shaikh, Maulik V Vaghela, Tim Wawrzynczak,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/56266
to review the following change.
Change subject: drivers/usb/acpi: Avoid dereferencing maybe-NULL pointer ......................................................................
drivers/usb/acpi: Avoid dereferencing maybe-NULL pointer
Do not dereference a pointer before checking whether it is NULL.
Change-Id: Icbe9ae99d91fd587d8e56cf3a0dcb59834ee6d07 Found-by: Coverity CID 1458232 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/drivers/usb/acpi/usb_acpi.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/66/56266/1
diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c index 8ada939..18175be 100644 --- a/src/drivers/usb/acpi/usb_acpi.c +++ b/src/drivers/usb/acpi/usb_acpi.c @@ -125,12 +125,12 @@
bool usb_acpi_get_pld(const struct device *usb_device, struct acpi_pld *pld) { - struct drivers_usb_acpi_config *config = usb_device->chip_info; - if (!usb_device || !usb_device->chip_info || usb_device->chip_ops != &drivers_usb_acpi_ops) return false;
+ struct drivers_usb_acpi_config *config = usb_device->chip_info; + if (config->use_custom_pld) *pld = config->custom_pld; else