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>
This commit is contained in:
Karthikeyan Ramasubramanian 2021-07-02 14:35:41 -06:00 committed by Patrick Georgi
parent 4693f3dfe9
commit bb87552c98
1 changed files with 2 additions and 2 deletions

View File

@ -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, &lte_reset_gpio,
memcpy(&config->reset_gpio, lte_reset_gpio,
sizeof(config->reset_gpio));
config->reset_off_delay_ms = 20;
memcpy(&config->enable_gpio, &lte_enable_gpio,
memcpy(&config->enable_gpio, lte_enable_gpio,
sizeof(config->enable_gpio));
config->enable_delay_ms = 20;
}