Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118354
b: refs/heads/master
c: 5769907
h: refs/heads/master
v: v3
  • Loading branch information
Max Dmitrichenko authored and David S. Miller committed Nov 2, 2008
1 parent 6f786a7 commit c4fb0c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1995a6599044076e2e13512ffbcecc49865e63e
refs/heads/master: 5769907ade8dda7002b304c03ef9e4ee5c1e0821
10 changes: 9 additions & 1 deletion trunk/arch/sparc64/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ static int __pci_mmap_make_offset(struct pci_dev *pdev,

for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
struct resource *rp = &pdev->resource[i];
resource_size_t aligned_end;

/* Active? */
if (!rp->flags)
Expand All @@ -906,8 +907,15 @@ static int __pci_mmap_make_offset(struct pci_dev *pdev,
continue;
}

/* Align the resource end to the next page address.
* PAGE_SIZE intentionally added instead of (PAGE_SIZE - 1),
* because actually we need the address of the next byte
* after rp->end.
*/
aligned_end = (rp->end + PAGE_SIZE) & PAGE_MASK;

if ((rp->start <= user_paddr) &&
(user_paddr + user_size) <= (rp->end + 1UL))
(user_paddr + user_size) <= aligned_end)
break;
}

Expand Down

0 comments on commit c4fb0c6

Please sign in to comment.