|
@@ -1797,7 +1797,7 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw,
|
|
|
u64 node_guid;
|
|
u64 node_guid;
|
|
|
int err = 0;
|
|
int err = 0;
|
|
|
|
|
|
|
|
- if (!MLX5_CAP_GEN(esw->dev, vport_group_manager))
|
|
|
|
|
|
|
+ if (!esw || !MLX5_CAP_GEN(esw->dev, vport_group_manager))
|
|
|
return -EPERM;
|
|
return -EPERM;
|
|
|
if (!LEGAL_VPORT(esw, vport) || is_multicast_ether_addr(mac))
|
|
if (!LEGAL_VPORT(esw, vport) || is_multicast_ether_addr(mac))
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
@@ -1871,7 +1871,7 @@ int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,
|
|
|
{
|
|
{
|
|
|
struct mlx5_vport *evport;
|
|
struct mlx5_vport *evport;
|
|
|
|
|
|
|
|
- if (!MLX5_CAP_GEN(esw->dev, vport_group_manager))
|
|
|
|
|
|
|
+ if (!esw || !MLX5_CAP_GEN(esw->dev, vport_group_manager))
|
|
|
return -EPERM;
|
|
return -EPERM;
|
|
|
if (!LEGAL_VPORT(esw, vport))
|
|
if (!LEGAL_VPORT(esw, vport))
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|