git: 3146c8fa1969 - main - vt_fb: fix KASSERTs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 23 Jun 2025 06:27:40 UTC
The branch main has been updated by vexeduxr:
URL: https://cgit.FreeBSD.org/src/commit/?id=3146c8fa1969349431467ff357af3be12e49346f
commit 3146c8fa1969349431467ff357af3be12e49346f
Author: Ahmad Khalifa <vexeduxr@FreeBSD.org>
AuthorDate: 2025-06-23 04:38:50 +0000
Commit: Ahmad Khalifa <vexeduxr@FreeBSD.org>
CommitDate: 2025-06-23 06:23:21 +0000
vt_fb: fix KASSERTs
Make sure there is enough room to write more than one byte.
Reviewed by: manu, imp
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D50842
---
sys/dev/vt/hw/fb/vt_fb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/dev/vt/hw/fb/vt_fb.c b/sys/dev/vt/hw/fb/vt_fb.c
index 5031ab946203..151129208f27 100644
--- a/sys/dev/vt/hw/fb/vt_fb.c
+++ b/sys/dev/vt/hw/fb/vt_fb.c
@@ -74,7 +74,7 @@ static void
vt_fb_mem_wr2(struct fb_info *sc, uint32_t o, uint16_t v)
{
- KASSERT((o < sc->fb_size), ("Offset %#08x out of fb size", o));
+ KASSERT((o + 1 < sc->fb_size), ("Offset %#08x out of fb size", o + 1));
*(uint16_t *)(sc->fb_vbase + o) = v;
}
@@ -82,7 +82,7 @@ static void
vt_fb_mem_wr4(struct fb_info *sc, uint32_t o, uint32_t v)
{
- KASSERT((o < sc->fb_size), ("Offset %#08x out of fb size", o));
+ KASSERT((o + 3 < sc->fb_size), ("Offset %#08x out of fb size", o + 3));
*(uint32_t *)(sc->fb_vbase + o) = v;
}