]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: enetc: fix the off-by-one issue in enetc_map_tx_buffs()
authorWei Fang <wei.fang@nxp.com>
Mon, 24 Feb 2025 11:12:44 +0000 (19:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2025 15:45:46 +0000 (16:45 +0100)
commit9561b0550c496aecc21f20261ea8d0d388fe69c4
tree1ebd670ebe2db205a2b7da9b55e27f0c65cfd5ff
parenta2ee5e55b50a97d13617c8653482c0ad4decff8c
net: enetc: fix the off-by-one issue in enetc_map_tx_buffs()

commit 39ab773e4c120f7f98d759415ccc2aca706bbc10 upstream.

When a DMA mapping error occurs while processing skb frags, it will free
one more tx_swbd than expected, so fix this off-by-one issue.

Fixes: d4fd0404c1c9 ("enetc: Introduce basic PF and VF ENETC ethernet drivers")
Cc: stable@vger.kernel.org
Suggested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Suggested-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Link: https://patch.msgid.link/20250224111251.1061098-2-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/freescale/enetc/enetc.c