git: f74d7fc4131d - main - thunderbolt: Account for CRC in router config write message size

From: Aymeric Wibo <obiwac_at_FreeBSD.org>
Date: Thu, 17 Sep 2026 00:18:38 UTC
The branch main has been updated by obiwac:

URL: https://cgit.FreeBSD.org/src/commit/?id=f74d7fc4131d6aca081d10e92e7bc19584a20d77

commit f74d7fc4131d6aca081d10e92e7bc19584a20d77
Author:     Aymeric Wibo <obiwac@FreeBSD.org>
AuthorDate: 2026-09-17 00:18:31 +0000
Commit:     Aymeric Wibo <obiwac@FreeBSD.org>
CommitDate: 2026-09-17 00:18:31 +0000

    thunderbolt: Account for CRC in router config write message size
    
    Fixes:          9c6e9bfb3474 ("thunderbolt: Support writing to router config space")
    Sponsored by:   The FreeBSD Foundation
---
 sys/dev/thunderbolt/router.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/dev/thunderbolt/router.c b/sys/dev/thunderbolt/router.c
index a92f008e21eb..e35c712e4a00 100644
--- a/sys/dev/thunderbolt/router.c
+++ b/sys/dev/thunderbolt/router.c
@@ -534,7 +534,8 @@ _tb_config_write(struct router_softc *sc, u_int space, u_int adapter,
 {
 	struct router_command *cmd;
 	struct tb_cfg_write *msg;
-	size_t msglen = sizeof(*msg) + dwlen * 4;
+	/* +4 to account for the CRC at the end. */
+	size_t msglen = sizeof(*msg) + dwlen * 4 + 4;
 	int error;
 
 	if ((error = router_alloc_cmd(sc, &cmd)) != 0)