* [PATCH] net/mlx5: Uninitialized variable in esw_add_uc_addr()
@ 2017-08-09 21:28 Dan Carpenter
2017-08-10 11:21 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-08-09 21:28 UTC (permalink / raw)
To: Saeed Mahameed; +Cc: Matan Barak, Leon Romanovsky, linux-rdma, kernel-janitors
"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;
/* Skip mlx5_mpfs_add_mac for PFs,
* it is already done by the PF netdev in mlx5e_execute_l2_action
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net/mlx5: Uninitialized variable in esw_add_uc_addr()
2017-08-09 21:28 [PATCH] net/mlx5: Uninitialized variable in esw_add_uc_addr() Dan Carpenter
@ 2017-08-10 11:21 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2017-08-10 11:21 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Saeed Mahameed, Matan Barak, linux-rdma, kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-10 11:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-09 21:28 [PATCH] net/mlx5: Uninitialized variable in esw_add_uc_addr() Dan Carpenter
2017-08-10 11:21 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox