]> 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)
commit1a20fa0f8f0394287adafcd9e4b7256716d60c13
tree8cd93da2e57391896eb68afedb830d0742849bb5
parent1a47924078241eec7de3957da13e6d3c89f872b3
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: ec09c2da77158 ("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