]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns: Fix memleak in hns_nic_dev_probe
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Mon, 24 Aug 2020 05:44:42 +0000 (13:44 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Aug 2020 12:52:54 +0000 (05:52 -0700)
commit8cb55d6ed8facdce1a7f0be9775330a07b5671a8
tree8cd93da2e57391896eb68afedb830d0742849bb5
parenta27f431f31202d25b2e459abd212042ca88be20b
net: hns: Fix memleak in hns_nic_dev_probe

hns_nic_dev_probe allocates ndev, but not free it on
two error handling paths, which may lead to memleak.

Fixes: d8c189bb6fbaf ("net: hns: net: hns: enet adds support of acpi")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_enet.c