Author: myles Date: 2009-05-28 23:57:11 +0200 (Thu, 28 May 2009) New Revision: 4319
Modified: trunk/coreboot-v2/src/devices/device_util.c Log: Make memmove copy (dev->resources -i) resource structs instead of (dev->resources-i) bytes in compact_resources.
Signed-off-by: Myles Watson mylesgw@gmail.com Acked-by: Peter Stuge peter@stuge.se
Modified: trunk/coreboot-v2/src/devices/device_util.c =================================================================== --- trunk/coreboot-v2/src/devices/device_util.c 2009-05-27 18:55:19 UTC (rev 4318) +++ trunk/coreboot-v2/src/devices/device_util.c 2009-05-28 21:57:11 UTC (rev 4319) @@ -272,7 +272,8 @@ for(i = 0; i < dev->resources;) { resource = &dev->resource[i]; if (!resource->flags) { - memmove(resource, resource + 1, dev->resources - i); + memmove(resource, resource + 1, (dev->resources - i) * + sizeof(*resource)); dev->resources -= 1; memset(&dev->resource[dev->resources], 0, sizeof(*resource)); } else {