소스 검색

mlx5: ensure 0 is returned when vport is zero

Currently, if vport is zero then then an uninialized return status
in err is returned.  Since the only return status at the end of the
function esw_add_uc_addr is zero for the current set of return paths
we may as well just return 0 rather than err to fix this issue.

Detected by CoverityScan, CID#1452698 ("Uninitialized scalar variable")

Fixes: eeb66cdb6826 ("net/mlx5: Separate between E-Switch and MPFS")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Colin Ian King 8 년 전
부모
커밋
1547f538c1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

+ 1 - 1
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

@@ -401,7 +401,7 @@ fdb_add:
 	esw_debug(esw->dev, "\tADDED UC MAC: vport[%d] %pM fr(%p)\n",
 	esw_debug(esw->dev, "\tADDED UC MAC: vport[%d] %pM fr(%p)\n",
 		  vport, mac, vaddr->flow_rule);
 		  vport, mac, vaddr->flow_rule);
 
 
-	return err;
+	return 0;
 }
 }
 
 
 static int esw_del_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr)
 static int esw_del_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr)