Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/27446
Change subject: Coverity: Fix CID1393978 ......................................................................
Coverity: Fix CID1393978
Fix a typo. Only memcpy into target buffer if pointer is not NULL.
Change-Id: I1aa4b2ce1843e53ab6ed2224eaa928fc79ea3b83 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/vendorcode/cavium/bdk/libbdk-hal/device/bdk-device.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/27446/1
diff --git a/src/vendorcode/cavium/bdk/libbdk-hal/device/bdk-device.c b/src/vendorcode/cavium/bdk/libbdk-hal/device/bdk-device.c index a8e65f0..0df70eb 100644 --- a/src/vendorcode/cavium/bdk/libbdk-hal/device/bdk-device.c +++ b/src/vendorcode/cavium/bdk/libbdk-hal/device/bdk-device.c @@ -519,7 +519,7 @@ { int grow = device_list_max + DEVICE_GROW; bdk_device_t *tmp = malloc(grow * sizeof(bdk_device_t)); - if (!tmp) + if (tmp) memcpy(tmp, device_list, device_list_max * sizeof(bdk_device_t)); free(device_list); if (tmp == NULL)