DPDK patches and discussions
 help / color / mirror / Atom feed
From: Slava Ovsiienko <viacheslavo@mellanox.com>
To: Ali Alnubani <alialnu@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Shahaf Shuler <shahafs@mellanox.com>, Dekel Peled <dekelp@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: add missing return value check
Date: Thu, 21 Mar 2019 09:26:22 +0000	[thread overview]
Message-ID: <AM4PR05MB32653492F2ACD077F1606411D2420@AM4PR05MB3265.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20190321090652.32535-1-alialnu@mellanox.com>

Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Ali Alnubani
> Sent: Thursday, March 21, 2019 11:07
> To: dev@dpdk.org
> Cc: Shahaf Shuler <shahafs@mellanox.com>; Dekel Peled
> <dekelp@mellanox.com>
> Subject: [dpdk-dev] [PATCH] net/mlx5: add missing return value check
> 
> Fixes: d86406b965df ("net/mlx5: support new representor naming format")
> Cc: dekelp@mellanox.com
> 
> Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> 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 = false;
>  	bool port_switch_id_set = false;
>  	char c;
> +	int ret;
> 
>  	if (!if_indextoname(ifindex, ifname)) {
>  		rte_errno = errno;
> @@ -1378,9 +1379,10 @@ mlx5_sysfs_switch_info(unsigned int ifindex,
> struct mlx5_switch_info *info)
> 
>  	file = fopen(phys_port_name, "rb");
>  	if (file != NULL) {
> -		fscanf(file, "%s", port_name);
> +		ret = fscanf(file, "%s", port_name);
>  		fclose(file);
> -		port_name_set = mlx5_translate_port_name(port_name,
> &data);
> +		if (ret == 1)
> +			port_name_set =
> mlx5_translate_port_name(port_name, &data);
>  	}
>  	file = fopen(phys_switch_id, "rb");
>  	if (file == NULL) {
> --
> 2.19.2

  parent reply	other threads:[~2019-03-21  9:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21  9:07 Ali Alnubani
2019-03-21  9:07 ` Ali Alnubani
2019-03-21  9:26 ` Slava Ovsiienko [this message]
2019-03-21  9:26   ` Slava Ovsiienko
2019-03-21  9:34 ` Dekel Peled
2019-03-21  9:34   ` Dekel Peled
2019-03-24  9:26   ` Shahaf Shuler
2019-03-24  9:26     ` Shahaf Shuler
2019-03-25 12:02     ` Ferruh Yigit
2019-03-25 12:02       ` Ferruh Yigit
2019-03-27  9:31       ` Ferruh Yigit
2019-03-27  9:31         ` Ferruh Yigit
2019-03-28 10:29         ` Ali Alnubani
2019-03-28 10:29           ` Ali Alnubani
2019-03-28 18:28           ` Ferruh Yigit
2019-03-28 18:28             ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM4PR05MB32653492F2ACD077F1606411D2420@AM4PR05MB3265.eurprd05.prod.outlook.com \
    --to=viacheslavo@mellanox.com \
    --cc=alialnu@mellanox.com \
    --cc=dekelp@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=shahafs@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).