]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix a wrong checking in the hclge_tx_buffer_calc()
authorHuazhong Tan <tanhuazhong@huawei.com>
Sat, 2 Feb 2019 14:39:32 +0000 (22:39 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Feb 2019 16:24:08 +0000 (08:24 -0800)
commitc28ad51c75e650c925f500fdeb56e9d13d9bcfe4
treee25bc772cd02a91c5f97695de5d4113f3ed2427f
parent17da45178f1c3ea7b3c344968be5f81ab6e347a9
net: hns3: fix a wrong checking in the hclge_tx_buffer_calc()

Only the TC is enabled, we need to check whether the buffer is enough,
otherwise it may lead to a wrong -ENOMEM case.

Fixes: 23d8cb26ea57 ("net: hns3: Support for dynamically assigning tx buffer to TC")
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_main.c