Return-Path: Received: from mail-bn3nam01on0100.outbound.protection.outlook.com ([104.47.33.100]:42055 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727955AbeH3WOp (ORCPT ); Thu, 30 Aug 2018 18:14:45 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: Xi Wang , Peng Li , Salil Mehta , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.14 29/67] net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero Date: Thu, 30 Aug 2018 18:10:31 +0000 Message-ID: <20180830180918.36327-29-alexander.levin@microsoft.com> References: <20180830180918.36327-1-alexander.levin@microsoft.com> In-Reply-To: <20180830180918.36327-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Xi Wang [ Upstream commit 6c39d5278e62956238a681e4cfc69fae5507fc57 ] 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 & Compatibili= ty Layer Support") Signed-off-by: Xi Wang Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/driv= ers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index c133491ad9fa..654aad6e748b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3105,7 +3105,7 @@ static bool hclge_is_all_function_id_zero(struct hclg= e_desc *desc) #define HCLGE_FUNC_NUMBER_PER_DESC 6 int i, j; =20 - for (i =3D 0; i < HCLGE_DESC_NUMBER; i++) + for (i =3D 1; i < HCLGE_DESC_NUMBER; i++) for (j =3D 0; j < HCLGE_FUNC_NUMBER_PER_DESC; j++) if (desc[i].data[j]) return false; --=20 2.17.1