]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Jul 2020 23:55:39 +0000 (16:55 -0700)
commit6550ce42176e985e3a2499e11493e0df2558f5f9
treef41f4ea9d59f4373389670359cc35a3720306855
parent5137946112f299cdd1eb59f57b57cb2be2714f26
net: nixge: fix potential memory leak in nixge_probe()

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

Fixes: c358d2422cb0 ("net: nixge: Separate ctrl and dma resources")
Fixes: 542b9441b639 ("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>
drivers/net/ethernet/ni/nixge.c