From: Xi Wang Date: Tue, 14 Aug 2018 16:13:13 +0000 (+0100) Subject: net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero X-Git-Tag: Ubuntu-5.2.0-15.16~3800^2~11^2~6 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=6c39d5278e62956238a681e4cfc69fae5507fc57;p=mirror_ubuntu-eoan-kernel.git net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero According to the functional specification of hardware, the first descriptor of response from command 'lookup vlan talbe' is not valid. Currently, the first descriptor is parsed as normal value, which will cause an expected error. This patch fixes this problem by skipping the first descriptor. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Xi Wang Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 92091221202b..5f30ea4c5142 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3930,7 +3930,7 @@ static bool hclge_is_all_function_id_zero(struct hclge_desc *desc) #define HCLGE_FUNC_NUMBER_PER_DESC 6 int i, j; - for (i = 0; i < HCLGE_DESC_NUMBER; i++) + for (i = 1; i < HCLGE_DESC_NUMBER; i++) for (j = 0; j < HCLGE_FUNC_NUMBER_PER_DESC; j++) if (desc[i].data[j]) return false;