]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: prevent double free in hns3_put_ring_config()
authorHuazhong Tan <tanhuazhong@huawei.com>
Thu, 25 Apr 2019 12:42:54 +0000 (20:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Apr 2019 16:13:28 +0000 (12:13 -0400)
commit1e10ef3b7dc2e3bfe4dd62f16a8446e06f9c9504
tree3f9a26324cb4717476f4f9ac0149074d4119b0ad
parent4ce73dde913aa9ba245fe40b2a43541c858da3d7
net: hns3: prevent double free in hns3_put_ring_config()

This patch adds a check for the hns3_put_ring_config() to prevent
double free, and for more readable, move the NULL assignment of
priv->ring_data into the hns3_put_ring_config().

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