Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329205
b: refs/heads/master
c: e38c0a1
h: refs/heads/master
i:
  329203: 252e64f
v: v3
  • Loading branch information
Thierry Reding authored and Rob Herring committed Sep 7, 2012
1 parent 1c1e020 commit 50e036f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a4f8bf220e415318c739243aaeb2471cf5e8c911
refs/heads/master: e38c0a1fbc5803cbacdaac0557c70ac8ca5152e7
8 changes: 8 additions & 0 deletions trunk/drivers/of/address.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 50e036f

Please sign in to comment.