Skip to content

Commit 91ca427

Browse files
committed
mm: fixed a typo in offset calculation
1 parent 6fef4bd commit 91ca427

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/memory/mmio.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ uintptr_t mmio(Thread *t, uintptr_t addr, off_t count, int flags) {
3636
// only root can do this
3737
if(p->user) return 0;
3838

39-
off_t offset = addr & ~(PAGE_SIZE-1);
39+
off_t offset = addr & (PAGE_SIZE-1);
4040
size_t pageCount = (count + PAGE_SIZE - 1) / PAGE_SIZE;
4141
if(addr & ~(PAGE_SIZE-1)) pageCount++;
4242

0 commit comments

Comments
 (0)