]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ethernet: atheros: fix a memleak in atl1e_setup_ring_resources
authorZhipeng Lu <alexious@zju.edu.cn>
Thu, 14 Dec 2023 13:04:04 +0000 (21:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2024 14:12:24 +0000 (15:12 +0100)
commitbe0988c9b0754c2ae88606422f8c40defef9cfb2
tree5d3de6ba21bd286b87056bd96014bebfaa8832d1
parent8b6f8bfe3a3a0939edcc8b1fdca5c11d754e9245
ethernet: atheros: fix a memleak in atl1e_setup_ring_resources

[ Upstream commit 309fdb1c33fe726d92d0030481346f24e1b01f07 ]

In the error handling of 'offset > adapter->ring_size', the
tx_ring->tx_buffer allocated by kzalloc should be freed,
instead of 'goto failed' instantly.

Fixes: a6a5325239c2 ("atl1e: Atheros L1E Gigabit Ethernet driver")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Reviewed-by: Suman Ghosh <sumang@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/atheros/atl1e/atl1e_main.c