diff options
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/address.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c index 7a07751428d..72e496f1e9b 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c | |||
@@ -69,6 +69,14 @@ static u64 of_bus_default_map(u32 *addr, const __be32 *range, | |||
69 | (unsigned long long)cp, (unsigned long long)s, | 69 | (unsigned long long)cp, (unsigned long long)s, |
70 | (unsigned long long)da); | 70 | (unsigned long long)da); |
71 | 71 | ||
72 | /* | ||
73 | * If the number of address cells is larger than 2 we assume the | ||
74 | * mapping doesn't specify a physical address. Rather, the address | ||
75 | * specifies an identifier that must match exactly. | ||
76 | */ | ||
77 | if (na > 2 && memcmp(range, addr, na * 4) != 0) | ||
78 | return OF_BAD_ADDR; | ||
79 | |||
72 | if (da < cp || da >= (cp + s)) | 80 | if (da < cp || da >= (cp + s)) |
73 | return OF_BAD_ADDR; | 81 | return OF_BAD_ADDR; |
74 | return da - cp; | 82 | return da - cp; |