]> git.baikalelectronics.ru Git - kernel.git/commit
net: atlantic: fix potential memory leak in aq_ndev_close()
authorJianglei Nie <niejianglei2021@163.com>
Wed, 14 Sep 2022 01:42:38 +0000 (09:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Sep 2022 11:50:57 +0000 (12:50 +0100)
commitac998d4eedefabb1c4d5f0929979ba5ebdf5d2b7
treedd9a27049e66a3296a132ee432ba83bd39c150ad
parent261eac8bcbd27bd17d3e62f84096073fd29ca880
net: atlantic: fix potential memory leak in aq_ndev_close()

If aq_nic_stop() fails, aq_ndev_close() returns err without calling
aq_nic_deinit() to release the relevant memory and resource, which
will lead to a memory leak.

We can fix it by deleting the if condition judgment and goto statement to
call aq_nic_deinit() directly after aq_nic_stop() to fix the memory leak.

Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_main.c