summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/memrange.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/memrange.c b/src/lib/memrange.c
index 0ebac0534e..7fb6ef7b06 100644
--- a/src/lib/memrange.c
+++ b/src/lib/memrange.c
@@ -258,6 +258,9 @@ static void collect_ranges(void *gp, struct device *dev, struct resource *res)
{
struct collect_context *ctx = gp;
+ if (res->size == 0)
+ return;
+
memranges_insert(ctx->ranges, res->base, res->size, ctx->tag);
}