diff --git a/[refs] b/[refs] index 1a1feebedd5d..3974f08112ce 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a4f8bf220e415318c739243aaeb2471cf5e8c911 +refs/heads/master: e38c0a1fbc5803cbacdaac0557c70ac8ca5152e7 diff --git a/trunk/drivers/of/address.c b/trunk/drivers/of/address.c index 7a07751428de..72e496f1e9b0 100644 --- a/trunk/drivers/of/address.c +++ b/trunk/drivers/of/address.c @@ -69,6 +69,14 @@ static u64 of_bus_default_map(u32 *addr, const __be32 *range, (unsigned long long)cp, (unsigned long long)s, (unsigned long long)da); + /* + * If the number of address cells is larger than 2 we assume the + * mapping doesn't specify a physical address. Rather, the address + * specifies an identifier that must match exactly. + */ + if (na > 2 && memcmp(range, addr, na * 4) != 0) + return OF_BAD_ADDR; + if (da < cp || da >= (cp + s)) return OF_BAD_ADDR; return da - cp;