From bb87552c98ae2419dcf853fe0db97c0895f6894d Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Fri, 2 Jul 2021 14:35:41 -0600 Subject: [PATCH] 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 Found-by: Coverity CID 1458053, 1458054. Reviewed-on: https://review.coreboot.org/c/coreboot/+/56046 Reviewed-by: Evan Green Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/mainboard/google/dedede/variants/baseboard/ramstage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mainboard/google/dedede/variants/baseboard/ramstage.c b/src/mainboard/google/dedede/variants/baseboard/ramstage.c index 136fe1354f..aedaa3f656 100644 --- a/src/mainboard/google/dedede/variants/baseboard/ramstage.c +++ b/src/mainboard/google/dedede/variants/baseboard/ramstage.c @@ -35,10 +35,10 @@ void update_lte_device(struct acpi_gpio *lte_reset_gpio, struct acpi_gpio *lte_e 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; }