summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/devices/device_util.c3
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 {