diff options
| author | Joshua Bakita <bakitajoshua@gmail.com> | 2024-09-25 12:44:16 -0400 |
|---|---|---|
| committer | Joshua Bakita <bakitajoshua@gmail.com> | 2024-09-25 12:52:42 -0400 |
| commit | 2104d15eb12b03ed4cfa8eb4dc95ad13cee43227 (patch) | |
| tree | 780a4a5bce26d780b3a5db6d7faa032b10d30d46 | |
| parent | 3ceb1066a751140f28444d2021f2841dd85fd482 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -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 |
| 70 | relocate: | 70 | relocate: |
