]> git.ipfire.org Git - thirdparty/linux.git/commit
net: bcmgenet: fix off-by-one in bcmgenet_put_txcb
authorJustin Chen <justin.chen@broadcom.com>
Mon, 6 Apr 2026 17:57:54 +0000 (10:57 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 10 Apr 2026 03:19:45 +0000 (20:19 -0700)
commit57f3f53d2c9c5a9e133596e2f7bc1c50688a6d38
treeee0efb4ce222121b032779aa60cf7825db460a8f
parentb02e3c4c80c91693b05c82751149d05d921bccb9
net: bcmgenet: fix off-by-one in bcmgenet_put_txcb

The write_ptr points to the next open tx_cb. We want to return the
tx_cb that gets rewinded, so we must rewind the pointer first then
return the tx_cb that it points to. That way the txcb can be correctly
cleaned up.

Fixes: 876dbadd53a7 ("net: bcmgenet: Fix unmapping of fragments in bcmgenet_xmit()")
Signed-off-by: Justin Chen <justin.chen@broadcom.com>
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Link: https://patch.msgid.link/20260406175756.134567-2-justin.chen@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/genet/bcmgenet.c