]> git.baikalelectronics.ru Git - kernel.git/commit
ethernet: aeroflex: fix potential skb leak in greth_init_rings()
authorZhang Changzhong <zhangchangzhong@huawei.com>
Sun, 4 Dec 2022 06:09:08 +0000 (14:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:30:47 +0000 (11:30 +0100)
commit8057cf1d96d172dff5f02946c36f3b2f12245eed
tree553bb6361b0591d7a6fcfc6264d58f07957a04eb
parent8ad7449026bd866c52e094a2f6d95a93d66c8b3d
ethernet: aeroflex: fix potential skb leak in greth_init_rings()

[ Upstream commit 063a932b64db3317ec020c94466fe52923a15f60 ]

The greth_init_rings() function won't free the newly allocated skb when
dma_mapping_error() returns error, so add dev_kfree_skb() to fix it.

Compile tested only.

Fixes: 7c2a0febc262 ("net: Add Aeroflex Gaisler 10/100/1G Ethernet MAC driver")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/1670134149-29516-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/aeroflex/greth.c