diff mbox

net/mlx5: Uninitialized variable in esw_add_uc_addr()

Message ID 20170809072418.e4x5xmbvboadhe5w@mwanda (mailing list archive)
State Not Applicable
Headers show

Commit Message

Dan Carpenter Aug. 9, 2017, 9:28 p.m. UTC
"err" isn't initialized if we hit the "goto fdb_add;".

Fixes: eeb66cdb6826 ("net/mlx5: Separate between E-Switch and MPFS")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Leon Romanovsky Aug. 10, 2017, 11:21 a.m. UTC | #1
On Thu, Aug 10, 2017 at 12:28:11AM +0300, Dan Carpenter wrote:
> "err" isn't initialized if we hit the "goto fdb_add;".
>
> Fixes: eeb66cdb6826 ("net/mlx5: Separate between E-Switch and MPFS")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> index fd51f0ea8df9..baed45c0dabe 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> @@ -376,7 +376,7 @@ static int esw_add_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr)
>  {
>  	u8 *mac = vaddr->node.addr;
>  	u32 vport = vaddr->vport;
> -	int err;
> +	int err = 0;

I'm not sure that it is the right error value which we want to return in
case of vprot == 0 was supplied.

Saeed ?

>
>  	/* Skip mlx5_mpfs_add_mac for PFs,
>  	 * it is already done by the PF netdev in mlx5e_execute_l2_action
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index fd51f0ea8df9..baed45c0dabe 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -376,7 +376,7 @@  static int esw_add_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr)
 {
 	u8 *mac = vaddr->node.addr;
 	u32 vport = vaddr->vport;
-	int err;
+	int err = 0;
 
 	/* Skip mlx5_mpfs_add_mac for PFs,
 	 * it is already done by the PF netdev in mlx5e_execute_l2_action