[dpdk-dev] net/mlx5: fix tunnel_en initialization value

Message ID 201709120914.v8C9Evq8012512@mse01.zte.com.cn (mailing list archive)
State Superseded, archived
Headers

Checks

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

Commit Message

Congwen Zhang Sept. 12, 2017, 9:05 a.m. UTC
  In function mlx5_pci_probe(), tunnel_en actually be used without
being initialized. Fix it by initializing it to 0.

Signe-off-by: Congwen Zhang <zhang.congwen@zte.com.cn>
---
 drivers/net/mlx5/mlx5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Adrien Mazarguil Sept. 12, 2017, 10:19 a.m. UTC | #1
Hi Congwen,

On Tue, Sep 12, 2017 at 05:05:50PM +0800, Congwen Zhang wrote:
> In function mlx5_pci_probe(), tunnel_en actually be used without
> being initialized. Fix it by initializing it to 0.
> 
> Signe-off-by: Congwen Zhang <zhang.congwen@zte.com.cn>

Thanks, however it's already been addressed [1]. The related commit is only
part of dpdk-next-net though, it's not merged in the main tree yet.

[1] http://dpdk.org/ml/archives/dev/2017-September/074271.html

> ---
>  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 b7e5046..95e62ad 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -452,7 +452,7 @@ struct mlx5_args {
>  	struct ibv_device_attr device_attr;
>  	unsigned int sriov;
>  	unsigned int mps;
> -	unsigned int tunnel_en;
> +	unsigned int tunnel_en = 0;
>  	int idx;
>  	int i;
>  
> -- 
> 1.8.3.1
>
  

Patch

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index b7e5046..95e62ad 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -452,7 +452,7 @@  struct mlx5_args {
 	struct ibv_device_attr device_attr;
 	unsigned int sriov;
 	unsigned int mps;
-	unsigned int tunnel_en;
+	unsigned int tunnel_en = 0;
 	int idx;
 	int i;