]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 13:02:57 +0000 (14:02 +0100)
commitd5dc2eff82b519260a673234fac66008ac9392b9
tree7ed7da66737bc2b7a54f04ba5c43d44ffe4295ea
parenta9509b9ed8c65f2153090c2d454160eb41ea42d6
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: d4c41139df6e ("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>
(cherry picked from commit c7adcbd0fd3fde1b19150c3e955fb4a30c5bd9b7)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
drivers/net/ethernet/aeroflex/greth.c