[dpdk-dev,v3,3/4] net/mlx5: solve var may be used uninitialized

Message ID 152627427866.53058.3148404478984097246.stgit@localhost.localdomain (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Andy Green May 14, 2018, 5:04 a.m. UTC
  Signed-off-by: Andy Green <andy@warmcat.com>
Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 drivers/net/mlx5/mlx5.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Yongseok Koh May 15, 2018, 5:25 p.m. UTC | #1
> On May 13, 2018, at 10:04 PM, Andy Green <andy@warmcat.com> wrote:
> 
> Signed-off-by: Andy Green <andy@warmcat.com>
> Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
Acked-by: Yongseok Koh <yskoh@mellanox.com>
 
Thanks

> drivers/net/mlx5/mlx5.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
> index 8f983061a..4d379fb13 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -624,7 +624,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
> 	int err = 0;
> 	struct ibv_context *attr_ctx = NULL;
> 	struct ibv_device_attr_ex device_attr;
> -	unsigned int vf;
> +	unsigned int vf = 0;
> 	unsigned int mps;
> 	unsigned int cqe_comp;
> 	unsigned int tunnel_en = 0;
  

Patch

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 8f983061a..4d379fb13 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -624,7 +624,7 @@  mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	int err = 0;
 	struct ibv_context *attr_ctx = NULL;
 	struct ibv_device_attr_ex device_attr;
-	unsigned int vf;
+	unsigned int vf = 0;
 	unsigned int mps;
 	unsigned int cqe_comp;
 	unsigned int tunnel_en = 0;