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)
commit77296bf6a7b806b00a62b53436b1e8429becd244
treeb868061e4bce3d7be87ab96209ae1a9087b55be2
parent845e0d1d5290c3b242aa76f37b4a5cae287b6f75
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