diff options
author | Myles Watson <mylesgw@gmail.com> | 2009-05-28 21:57:11 +0000 |
---|---|---|
committer | Myles Watson <mylesgw@gmail.com> | 2009-05-28 21:57:11 +0000 |
commit | f9f4eaf7ab8c39691fc8b2019d511bdd17b27a37 (patch) | |
tree | b00b25993999c7bd4a9474b6304576cb5cb7d346 /src/devices | |
parent | 7365004424f58db813a092c24c404ec99507765f (diff) | |
download | coreboot-f9f4eaf7ab8c39691fc8b2019d511bdd17b27a37.tar.xz |
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>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4319 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/device_util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/devices/device_util.c b/src/devices/device_util.c index 692e40c6b0..aa23a2b34c 100644 --- a/src/devices/device_util.c +++ b/src/devices/device_util.c @@ -272,7 +272,8 @@ void compact_resources(device_t dev) 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 { |