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>
This commit is contained in:
Vladimir Serbinenko 2014-02-05 23:38:29 +01:00
parent 5b9e3b6051
commit 7a4fa0a32c
1 changed files with 3 additions and 0 deletions

View File

@ -258,6 +258,9 @@ static void collect_ranges(void *gp, struct device *dev, struct resource *res)
{ {
struct collect_context *ctx = gp; struct collect_context *ctx = gp;
if (res->size == 0)
return;
memranges_insert(ctx->ranges, res->base, res->size, ctx->tag); memranges_insert(ctx->ranges, res->base, res->size, ctx->tag);
} }