From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70043.outbound.protection.outlook.com [40.107.7.43]) by dpdk.org (Postfix) with ESMTP id 2B6B61B458 for ; Thu, 21 Mar 2019 10:34:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+Dzjjtu02eMkJPTSSaZLWHkIBQG+tSEFLVbSiCR1JuE=; b=uCNkGwyTQr7bA/0YX+stu4HLU8bpmpnrT7eQvISO9tcx6Gf0omN43s7Z/0oD3mTqh7qmWsYqgm9HMxCJzE1y/l5bspnP7Z4I2r5Q/ZOug4ArBVsPocBOE/2FuLmXpHSCWJB1d2SCemrp9wiI61ldXxcHvTaAXY0aWfroU7Td9FM= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB6509.eurprd05.prod.outlook.com (20.179.25.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.15; Thu, 21 Mar 2019 09:34:28 +0000 Received: from VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::bcb0:ed58:d76:cac]) by VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::bcb0:ed58:d76:cac%4]) with mapi id 15.20.1709.015; Thu, 21 Mar 2019 09:34:28 +0000 From: Dekel Peled To: Ali Alnubani , "dev@dpdk.org" CC: Shahaf Shuler Thread-Topic: [PATCH] net/mlx5: add missing return value check Thread-Index: AQHU38WAY+2M9ex/ak+E9IrZesqPu6YVzAig Date: Thu, 21 Mar 2019 09:34:27 +0000 Message-ID: References: <20190321090652.32535-1-alialnu@mellanox.com> In-Reply-To: <20190321090652.32535-1-alialnu@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 90462c65-e0e7-41b7-2650-08d6ade069f6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB6509; x-ms-traffictypediagnostic: VI1PR05MB6509: x-microsoft-antispam-prvs: x-forefront-prvs: 0983EAD6B2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(376002)(396003)(366004)(136003)(199004)(13464003)(189003)(316002)(256004)(71190400001)(8936002)(6246003)(76176011)(81156014)(68736007)(99286004)(486006)(71200400001)(7696005)(3846002)(446003)(6116002)(110136005)(81166006)(8676002)(107886003)(229853002)(476003)(4326008)(53936002)(33656002)(2501003)(305945005)(11346002)(25786009)(74316002)(186003)(66066001)(105586002)(26005)(102836004)(7736002)(6436002)(478600001)(106356001)(6506007)(53546011)(52536014)(14454004)(86362001)(55016002)(5660300002)(9686003)(2906002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB6509; H:VI1PR05MB4224.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:3; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 7G4eA3TzoWmDw4IExNtLP+qXT3ovRlRlZ3wKuUHyPys7JdjYz/PZKnw3d+UjJRKCK61psvsMN3JmxRvl/OATCpKVGxO6Uvx2oAic1qM8++Y/Co//dLiQEzhQp21mMnfqA8hXpxjvWC8ju3A8T4b6a4mz/hFce/vOuZ6hUy//+qWoqnnEsxABngJxVK05wsFvW7Y2+naDHj8aWI+jGpZQYkDeFKQl9IhYmNrUHg88gdkk5mbX4qmuXFJL9SHC+p9UCaRzaiDFMy5WM0gpocGomFX7qncVmsvzSdsNcPhENprMjiaHNgbP9me7Rq+WCBZC74BsELvpXKhQVSUMcsgZCDOA9X/YCg0rMPzZYhob1IPDxdDFTH+3PFG+2iDiG2srp8armGOZdLnUgEkRDDmmZXHByMrXxJGS2FB5rZANYs0= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90462c65-e0e7-41b7-2650-08d6ade069f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2019 09:34:27.9941 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB6509 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: add missing return value check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Mar 2019 09:34:49 -0000 > -----Original Message----- > From: Ali Alnubani > Sent: Thursday, March 21, 2019 11:07 AM > To: dev@dpdk.org > Cc: Shahaf Shuler ; Dekel Peled > > Subject: [PATCH] net/mlx5: add missing return value check >=20 > Fixes: d86406b965df ("net/mlx5: support new representor naming format") > Cc: dekelp@mellanox.com >=20 > Signed-off-by: Ali Alnubani > --- > drivers/net/mlx5/mlx5_ethdev.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_ethdev.c > b/drivers/net/mlx5/mlx5_ethdev.c index 84d761c8e..1fd988998 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -1365,6 +1365,7 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct > mlx5_switch_info *info) > bool port_name_set =3D false; > bool port_switch_id_set =3D false; > char c; > + int ret; >=20 > if (!if_indextoname(ifindex, ifname)) { > rte_errno =3D errno; > @@ -1378,9 +1379,10 @@ mlx5_sysfs_switch_info(unsigned int ifindex, > struct mlx5_switch_info *info) >=20 > file =3D fopen(phys_port_name, "rb"); > if (file !=3D NULL) { > - fscanf(file, "%s", port_name); > + ret =3D fscanf(file, "%s", port_name); > fclose(file); > - port_name_set =3D mlx5_translate_port_name(port_name, > &data); > + if (ret =3D=3D 1) > + port_name_set =3D > mlx5_translate_port_name(port_name, &data); > } > file =3D fopen(phys_switch_id, "rb"); > if (file =3D=3D NULL) { > -- > 2.19.2 Acked by: Dekel Peled From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id ADAC7A00E6 for ; Thu, 21 Mar 2019 10:34:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DDD121B475; Thu, 21 Mar 2019 10:34:50 +0100 (CET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70043.outbound.protection.outlook.com [40.107.7.43]) by dpdk.org (Postfix) with ESMTP id 2B6B61B458 for ; Thu, 21 Mar 2019 10:34:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+Dzjjtu02eMkJPTSSaZLWHkIBQG+tSEFLVbSiCR1JuE=; b=uCNkGwyTQr7bA/0YX+stu4HLU8bpmpnrT7eQvISO9tcx6Gf0omN43s7Z/0oD3mTqh7qmWsYqgm9HMxCJzE1y/l5bspnP7Z4I2r5Q/ZOug4ArBVsPocBOE/2FuLmXpHSCWJB1d2SCemrp9wiI61ldXxcHvTaAXY0aWfroU7Td9FM= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB6509.eurprd05.prod.outlook.com (20.179.25.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.15; Thu, 21 Mar 2019 09:34:28 +0000 Received: from VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::bcb0:ed58:d76:cac]) by VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::bcb0:ed58:d76:cac%4]) with mapi id 15.20.1709.015; Thu, 21 Mar 2019 09:34:28 +0000 From: Dekel Peled To: Ali Alnubani , "dev@dpdk.org" CC: Shahaf Shuler Thread-Topic: [PATCH] net/mlx5: add missing return value check Thread-Index: AQHU38WAY+2M9ex/ak+E9IrZesqPu6YVzAig Date: Thu, 21 Mar 2019 09:34:27 +0000 Message-ID: References: <20190321090652.32535-1-alialnu@mellanox.com> In-Reply-To: <20190321090652.32535-1-alialnu@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 90462c65-e0e7-41b7-2650-08d6ade069f6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB6509; x-ms-traffictypediagnostic: VI1PR05MB6509: x-microsoft-antispam-prvs: x-forefront-prvs: 0983EAD6B2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(376002)(396003)(366004)(136003)(199004)(13464003)(189003)(316002)(256004)(71190400001)(8936002)(6246003)(76176011)(81156014)(68736007)(99286004)(486006)(71200400001)(7696005)(3846002)(446003)(6116002)(110136005)(81166006)(8676002)(107886003)(229853002)(476003)(4326008)(53936002)(33656002)(2501003)(305945005)(11346002)(25786009)(74316002)(186003)(66066001)(105586002)(26005)(102836004)(7736002)(6436002)(478600001)(106356001)(6506007)(53546011)(52536014)(14454004)(86362001)(55016002)(5660300002)(9686003)(2906002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB6509; H:VI1PR05MB4224.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:3; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 7G4eA3TzoWmDw4IExNtLP+qXT3ovRlRlZ3wKuUHyPys7JdjYz/PZKnw3d+UjJRKCK61psvsMN3JmxRvl/OATCpKVGxO6Uvx2oAic1qM8++Y/Co//dLiQEzhQp21mMnfqA8hXpxjvWC8ju3A8T4b6a4mz/hFce/vOuZ6hUy//+qWoqnnEsxABngJxVK05wsFvW7Y2+naDHj8aWI+jGpZQYkDeFKQl9IhYmNrUHg88gdkk5mbX4qmuXFJL9SHC+p9UCaRzaiDFMy5WM0gpocGomFX7qncVmsvzSdsNcPhENprMjiaHNgbP9me7Rq+WCBZC74BsELvpXKhQVSUMcsgZCDOA9X/YCg0rMPzZYhob1IPDxdDFTH+3PFG+2iDiG2srp8armGOZdLnUgEkRDDmmZXHByMrXxJGS2FB5rZANYs0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90462c65-e0e7-41b7-2650-08d6ade069f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2019 09:34:27.9941 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB6509 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: add missing return value check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190321093427.xGbRe25L8s4iwDVYKavHv1W8ikNnoYSsFrws2p_z2o8@z> > -----Original Message----- > From: Ali Alnubani > Sent: Thursday, March 21, 2019 11:07 AM > To: dev@dpdk.org > Cc: Shahaf Shuler ; Dekel Peled > > Subject: [PATCH] net/mlx5: add missing return value check >=20 > Fixes: d86406b965df ("net/mlx5: support new representor naming format") > Cc: dekelp@mellanox.com >=20 > Signed-off-by: Ali Alnubani > --- > drivers/net/mlx5/mlx5_ethdev.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_ethdev.c > b/drivers/net/mlx5/mlx5_ethdev.c index 84d761c8e..1fd988998 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -1365,6 +1365,7 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct > mlx5_switch_info *info) > bool port_name_set =3D false; > bool port_switch_id_set =3D false; > char c; > + int ret; >=20 > if (!if_indextoname(ifindex, ifname)) { > rte_errno =3D errno; > @@ -1378,9 +1379,10 @@ mlx5_sysfs_switch_info(unsigned int ifindex, > struct mlx5_switch_info *info) >=20 > file =3D fopen(phys_port_name, "rb"); > if (file !=3D NULL) { > - fscanf(file, "%s", port_name); > + ret =3D fscanf(file, "%s", port_name); > fclose(file); > - port_name_set =3D mlx5_translate_port_name(port_name, > &data); > + if (ret =3D=3D 1) > + port_name_set =3D > mlx5_translate_port_name(port_name, &data); > } > file =3D fopen(phys_switch_id, "rb"); > if (file =3D=3D NULL) { > -- > 2.19.2 Acked by: Dekel Peled