]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: use devm_kcalloc when allocating desc_cb
authorYunsheng Lin <linyunsheng@huawei.com>
Mon, 6 May 2019 02:48:52 +0000 (10:48 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 May 2019 17:37:14 +0000 (10:37 -0700)
commit2d11d89712d8cf5a4de7ee37ad8260851e97b4c4
treeb868061e4bce3d7be87ab96209ae1a9087b55be2
parentd7b803eb5a16b465bbef9918050140fb37d64101
net: hns3: use devm_kcalloc when allocating desc_cb

This patch uses devm_kcalloc instead of kcalloc when allocating
ring->desc_cb, because devm_kcalloc not only ensure to free the
memory when the dev is deallocted, but also allocate the memory
from it's device memory node.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
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