OSDN Git Service

net: hns3: bugfix for buffer not free problem during resetting
authorHuazhong Tan <tanhuazhong@huawei.com>
Tue, 30 Oct 2018 13:50:44 +0000 (21:50 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Oct 2018 19:42:38 +0000 (12:42 -0700)
commit73b907a083b8a8c1c62cb494bc9fbe6ae086c460
tree83e7f678a3e27987ed47d82b58d27a479653d614
parentece4bf46e98c9f3775a488f3932a531508d3b1a2
net: hns3: bugfix for buffer not free problem during resetting

When hns3_get_ring_config()/hns3_queue_to_ring()/
hns3_get_vector_ring_chain() failed during resetting, the allocated
memory has not been freed before these three functions return. So
this patch adds error handler in these functions to fix it.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c