aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Bakita <bakitajoshua@gmail.com>2024-09-25 12:44:16 -0400
committerJoshua Bakita <bakitajoshua@gmail.com>2024-09-25 12:52:42 -0400
commit2104d15eb12b03ed4cfa8eb4dc95ad13cee43227 (patch)
tree780a4a5bce26d780b3a5db6d7faa032b10d30d46
parent3ceb1066a751140f28444d2021f2841dd85fd482 (diff)
Correct an off-by-one error in addr_to_pramin_mut()
Not known to cause any current bugs, but could cause the returned address to be inaccessible.
-rw-r--r--bus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bus.c b/bus.c
index f2369eb..cd84232 100644
--- a/bus.c
+++ b/bus.c
@@ -64,7 +64,7 @@ int addr_to_pramin_mut(struct nvdebug_state *g,
64 goto relocate; 64 goto relocate;
65 } 65 }
66 pramin_base = ((uint64_t)window.base) << 16; 66 pramin_base = ((uint64_t)window.base) << 16;
67 if (addr < pramin_base || addr > pramin_base + NV_PRAMIN_LEN) 67 if (addr < pramin_base || addr >= pramin_base + NV_PRAMIN_LEN)
68 goto relocate; 68 goto relocate;
69 return addr - pramin_base; // Guaranteed to be < 1MiB, so safe for int 69 return addr - pramin_base; // Guaranteed to be < 1MiB, so safe for int
70relocate: 70relocate: