From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00085.outbound.protection.outlook.com [40.107.0.85]) by dpdk.org (Postfix) with ESMTP id 4FDF21B48A for ; Thu, 21 Mar 2019 10:26:31 +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=6ZwuuBv5WNj5e3vdSjGWR3ZCLkFP6oY34MUGwI+Fo/c=; b=v2KASoVIMrCdoo+deZQMwMNlKcqEf/lHMvf8I2xTVBn/CNx4Y+loksSynwfIio4SIFdfJk0wbadrpQ3+i5d1mfT/GILvtp4FSOkz2H+JU9Z24qZwC2k9D8dPQiJn7uWBxF7lC9FUPjn3aqBZY3hAHjwgXb/0NM6prg20mbUSAIM= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3187.eurprd05.prod.outlook.com (10.171.186.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.16; Thu, 21 Mar 2019 09:26:22 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02%3]) with mapi id 15.20.1709.015; Thu, 21 Mar 2019 09:26:22 +0000 From: Slava Ovsiienko To: Ali Alnubani , "dev@dpdk.org" CC: Shahaf Shuler , Dekel Peled Thread-Topic: [PATCH] net/mlx5: add missing return value check Thread-Index: AQHU38WAY+2M9ex/ak+E9IrZesqPu6YV0GHQ Date: Thu, 21 Mar 2019 09:26:22 +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=viacheslavo@mellanox.com; x-originating-ip: [95.67.35.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: aa9763d4-4c4b-4a57-102d-08d6addf48a5 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:AM4PR05MB3187; x-ms-traffictypediagnostic: AM4PR05MB3187: x-microsoft-antispam-prvs: x-forefront-prvs: 0983EAD6B2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(346002)(376002)(39860400002)(396003)(13464003)(199004)(189003)(446003)(5660300002)(9686003)(86362001)(11346002)(76176011)(102836004)(107886003)(2501003)(14454004)(478600001)(186003)(486006)(25786009)(26005)(53546011)(2906002)(6506007)(476003)(316002)(8936002)(6246003)(52536014)(7696005)(81156014)(8676002)(256004)(6436002)(97736004)(110136005)(7736002)(305945005)(106356001)(55016002)(74316002)(4326008)(53936002)(229853002)(71190400001)(71200400001)(68736007)(81166006)(105586002)(3846002)(33656002)(6116002)(54906003)(99286004)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3187; H:AM4PR05MB3265.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: RBwblxVRCZcv5S2TW7ybiyzXUh2V2C97sw2Nz9TrG+ikhkpwu8td0Eh13YYf1rWUSj4CClosuhMhv8PPCSgY8SilV4IqXz/ehQ9YK4rs3kom6stRDaO6033buXVxd5zHLW9/4ORZ3Yi1/HDDO3161oawupx18yqwl5LZTtGnoQHix94IRe2n3tV6DI51L4TPZHOrORGlr7qAPuwZ+GRzCUj5HnQAgWBdnI8Tc0EqePgbo5LXudlzFe5DUmsjkagrxdpihtgFUHyXCwLVZ5taCQ6qC8xAQIh/UNP2eRTCT3i1r9M83cqiJBIcLKdbp6n0T5FPY1f0tYJtP9jE6gTBP0Lp/ViwUjk+OT+FNLekOFoyXCnmsCksKBtbksGyHPMw67gDTNBxnASELemkwBKjIjVOxXySdveQv9/zII051mc= 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: aa9763d4-4c4b-4a57-102d-08d6addf48a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2019 09:26:22.5962 (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: AM4PR05MB3187 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:26:31 -0000 Acked-by: Viacheslav Ovsiienko > -----Original Message----- > From: dev On Behalf Of Ali Alnubani > Sent: Thursday, March 21, 2019 11:07 > To: dev@dpdk.org > Cc: Shahaf Shuler ; Dekel Peled > > Subject: [dpdk-dev] [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 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 24DAFA00E6 for ; Thu, 21 Mar 2019 10:26:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0B5DD1B48A; Thu, 21 Mar 2019 10:26:32 +0100 (CET) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00085.outbound.protection.outlook.com [40.107.0.85]) by dpdk.org (Postfix) with ESMTP id 4FDF21B48A for ; Thu, 21 Mar 2019 10:26:31 +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=6ZwuuBv5WNj5e3vdSjGWR3ZCLkFP6oY34MUGwI+Fo/c=; b=v2KASoVIMrCdoo+deZQMwMNlKcqEf/lHMvf8I2xTVBn/CNx4Y+loksSynwfIio4SIFdfJk0wbadrpQ3+i5d1mfT/GILvtp4FSOkz2H+JU9Z24qZwC2k9D8dPQiJn7uWBxF7lC9FUPjn3aqBZY3hAHjwgXb/0NM6prg20mbUSAIM= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3187.eurprd05.prod.outlook.com (10.171.186.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.16; Thu, 21 Mar 2019 09:26:22 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::11b0:de86:8d93:8b02%3]) with mapi id 15.20.1709.015; Thu, 21 Mar 2019 09:26:22 +0000 From: Slava Ovsiienko To: Ali Alnubani , "dev@dpdk.org" CC: Shahaf Shuler , Dekel Peled Thread-Topic: [PATCH] net/mlx5: add missing return value check Thread-Index: AQHU38WAY+2M9ex/ak+E9IrZesqPu6YV0GHQ Date: Thu, 21 Mar 2019 09:26:22 +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=viacheslavo@mellanox.com; x-originating-ip: [95.67.35.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: aa9763d4-4c4b-4a57-102d-08d6addf48a5 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:AM4PR05MB3187; x-ms-traffictypediagnostic: AM4PR05MB3187: x-microsoft-antispam-prvs: x-forefront-prvs: 0983EAD6B2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(346002)(376002)(39860400002)(396003)(13464003)(199004)(189003)(446003)(5660300002)(9686003)(86362001)(11346002)(76176011)(102836004)(107886003)(2501003)(14454004)(478600001)(186003)(486006)(25786009)(26005)(53546011)(2906002)(6506007)(476003)(316002)(8936002)(6246003)(52536014)(7696005)(81156014)(8676002)(256004)(6436002)(97736004)(110136005)(7736002)(305945005)(106356001)(55016002)(74316002)(4326008)(53936002)(229853002)(71190400001)(71200400001)(68736007)(81166006)(105586002)(3846002)(33656002)(6116002)(54906003)(99286004)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3187; H:AM4PR05MB3265.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: RBwblxVRCZcv5S2TW7ybiyzXUh2V2C97sw2Nz9TrG+ikhkpwu8td0Eh13YYf1rWUSj4CClosuhMhv8PPCSgY8SilV4IqXz/ehQ9YK4rs3kom6stRDaO6033buXVxd5zHLW9/4ORZ3Yi1/HDDO3161oawupx18yqwl5LZTtGnoQHix94IRe2n3tV6DI51L4TPZHOrORGlr7qAPuwZ+GRzCUj5HnQAgWBdnI8Tc0EqePgbo5LXudlzFe5DUmsjkagrxdpihtgFUHyXCwLVZ5taCQ6qC8xAQIh/UNP2eRTCT3i1r9M83cqiJBIcLKdbp6n0T5FPY1f0tYJtP9jE6gTBP0Lp/ViwUjk+OT+FNLekOFoyXCnmsCksKBtbksGyHPMw67gDTNBxnASELemkwBKjIjVOxXySdveQv9/zII051mc= 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: aa9763d4-4c4b-4a57-102d-08d6addf48a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2019 09:26:22.5962 (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: AM4PR05MB3187 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: <20190321092622.hI6Je0jj3u95L1x4rXvzQSSfsP8dSkmAYSiKWYqDRig@z> Acked-by: Viacheslav Ovsiienko > -----Original Message----- > From: dev On Behalf Of Ali Alnubani > Sent: Thursday, March 21, 2019 11:07 > To: dev@dpdk.org > Cc: Shahaf Shuler ; Dekel Peled > > Subject: [dpdk-dev] [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