Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/56046 )
Change subject: mb/google/dedede: Fix the pointer/address used in memcpy ......................................................................
mb/google/dedede: Fix the pointer/address used in memcpy
The caller is already passing the address to the required LTE reset and enable GPIO. During memcpy, the address to that pointer is used which will lead to copying undefined data. Fix the pointer/address used in memcpy.
BUG=None BRANCH=dedede TEST=Build Kracko, Drawcia and Metaknight mainboards which use this function.
Change-Id: I79d6d9af03acd59ab5e1cd7df97bf451011dfeaa Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com Found-by: Coverity CID 1458053, 1458054. Reviewed-on: https://review.coreboot.org/c/coreboot/+/56046 Reviewed-by: Evan Green evgreen@chromium.org Reviewed-by: Furquan Shaikh furquan@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/dedede/variants/baseboard/ramstage.c 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Evan Green: Looks good to me, approved
diff --git a/src/mainboard/google/dedede/variants/baseboard/ramstage.c b/src/mainboard/google/dedede/variants/baseboard/ramstage.c index 136fe13..aedaa3f 100644 --- a/src/mainboard/google/dedede/variants/baseboard/ramstage.c +++ b/src/mainboard/google/dedede/variants/baseboard/ramstage.c @@ -35,10 +35,10 @@ config->type = UPC_TYPE_INTERNAL; if (port->path.usb.port_type == LTE_USB_PORT_TYPE) { config->has_power_resource = 1; - memcpy(&config->reset_gpio, <e_reset_gpio, + memcpy(&config->reset_gpio, lte_reset_gpio, sizeof(config->reset_gpio)); config->reset_off_delay_ms = 20; - memcpy(&config->enable_gpio, <e_enable_gpio, + memcpy(&config->enable_gpio, lte_enable_gpio, sizeof(config->enable_gpio)); config->enable_delay_ms = 20; }