]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix a memory leak issue for hclge_map_unmap_ring_to_vf_vector
authorHuazhong Tan <tanhuazhong@huawei.com>
Tue, 28 May 2019 09:03:02 +0000 (17:03 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 May 2019 00:39:01 +0000 (17:39 -0700)
commit36b2b6cd1b0936daa1248f859134b3cdeea908fa
tree8d9fed7219f419276aca3a1c4906b0c2c4654e1f
parente14d1bdd8747b5bc69797ca3ddea1131a61bb89b
net: hns3: fix a memory leak issue for hclge_map_unmap_ring_to_vf_vector

When hclge_bind_ring_with_vector() fails,
hclge_map_unmap_ring_to_vf_vector() returns the error
directly, so nobody will free the memory allocated by
hclge_get_ring_chain_from_mbx().

So hclge_free_vector_ring_chain() should be called no matter
hclge_bind_ring_with_vector() fails or not.

Fixes: 29753e452aad ("net: hns3: Change PF to add ring-vect binding & resetQ to mailbox")
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/hns3pf/hclge_mbx.c