summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-02-05 23:38:29 +0100
committerVladimir Serbinenko <phcoder@gmail.com>2014-02-06 00:55:06 +0100
commit7a4fa0a32cf11a0686804afffbcd02827c846fcf (patch)
treefa43fde87093d0f31eefd3cbafbf459c295c2519 /src/lib
parent5b9e3b60516d5255962604db7530089103f83ec1 (diff)
lib/memrange: Skip 0-sized resources.
Change-Id: I44194153817b8e6b641e407fc4a9e0fd5bc3f318 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/5152 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@google.com>
Diffstat (limited to 'src/lib')
-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);
}