From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dekel Peled Subject: Re: [PATCH] net/mlx5: add missing return value check Date: Thu, 21 Mar 2019 09:34:27 +0000 Message-ID: References: <20190321090652.32535-1-alialnu@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Shahaf Shuler To: Ali Alnubani , "dev@dpdk.org" 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) In-Reply-To: <20190321090652.32535-1-alialnu@mellanox.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----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