OSDN Git Service

net: hns3: fix error handling int the hns3_get_vector_ring_chain
authorHuazhong Tan <tanhuazhong@huawei.com>
Tue, 18 Dec 2018 11:37:48 +0000 (19:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:07 +0000 (14:50 +0100)
commit0120feccd1c1b5d3ccc8838f416a821d2a075b7f
treea03d98acc9501c3806f3f9eb78de5dcf8fc024bf
parent4b5b085667457258e8c6601675bf811cdd1d1177
net: hns3: fix error handling int the hns3_get_vector_ring_chain

[ Upstream commit cda69d244585bc4497d3bb878c22fe2b6ad647c1 ]

When hns3_get_vector_ring_chain() failed in the
hns3_nic_init_vector_data(), it should do the error handling instead
of return directly.

Also, cur_chain should be freed instead of chain and head->next should
be set to NULL in error handling of hns3_get_vector_ring_chain.

This patch fixes them.

Fixes: 73b907a083b8 ("net: hns3: bugfix for buffer not free problem during resetting")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c