]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Dec 2018 20:01:00 +0000 (12:01 -0800)
commit3646af0d5e5f99d06ae84d6b45ed7e195be8b185
tree903f131c4137f8c608615cec87ea42198dcfa7dd
parentae8b4016000ea8ae623f2968869d32a14677a84e
net: hns3: fix error handling int the hns3_get_vector_ring_chain

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: 0ff795c74841 ("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>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c