[coreboot-gerrit] Change in coreboot[master]: Coverity: Fix CID1393978

Patrick Rudolph (Code Review) gerrit at coreboot.org
Thu Jul 12 16:01:35 CEST 2018


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 at 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)

-- 
To view, visit https://review.coreboot.org/27446
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1aa4b2ce1843e53ab6ed2224eaa928fc79ea3b83
Gerrit-Change-Number: 27446
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph at 9elements.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180712/3701cc04/attachment-0001.html>


More information about the coreboot-gerrit mailing list