]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
net: nixge: fix potential memory leak in nixge_probe()
authorLu Wei <luwei32@huawei.com>
Wed, 29 Jul 2020 03:50:05 +0000 (11:50 +0800)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 4 Sep 2020 19:28:36 +0000 (16:28 -0300)
commitd3e926427b9cc37667d30b4d76aee7609e6b1663
treed992cbb3267f0c84c35db9fb0df7a5b78b96abd5
parentea037cc40cc323c08eae0058cf8fa011f4c76173
net: nixge: fix potential memory leak in nixge_probe()

BugLink: https://bugs.launchpad.net/bugs/1891063
[ Upstream commit 366228ed01f6882cc203e3d5b40010dfae0be1c3 ]

If some processes in nixge_probe() fail, free_netdev(dev)
needs to be called to aviod a memory leak.

Fixes: 87ab207981ec ("net: nixge: Separate ctrl and dma resources")
Fixes: abcd3d6fc640 ("net: nixge: Fix error path for obtaining mac address")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Lu Wei <luwei32@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/ethernet/ni/nixge.c