Skip to content

Commit cd4f186

Browse files
shayshyiSaeed Mahameed
authored andcommitted
net/mlx5: E-switch, Coverity: overlapping copy
When a capability is set via port function caps callbacks, a memcpy() is performed in which the source and the target are the same address, e.g.: the copy is redundant. Hence, Remove it. Discovered by Coverity. Fixes: 7db9839 ("net/mlx5: E-Switch, Implement devlink port function cmds to control RoCE") Fixes: e5b9642 ("net/mlx5: E-Switch, Implement devlink port function cmds to control migratable") Signed-off-by: Shay Drory <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent d515d63 commit cd4f186

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4143,8 +4143,6 @@ int mlx5_devlink_port_fn_migratable_set(struct devlink_port *port, bool enable,
41434143
}
41444144

41454145
hca_caps = MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability);
4146-
memcpy(hca_caps, MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability),
4147-
MLX5_UN_SZ_BYTES(hca_cap_union));
41484146
MLX5_SET(cmd_hca_cap_2, hca_caps, migratable, 1);
41494147

41504148
err = mlx5_vport_set_other_func_cap(esw->dev, hca_caps, vport->vport,
@@ -4236,8 +4234,6 @@ int mlx5_devlink_port_fn_roce_set(struct devlink_port *port, bool enable,
42364234
}
42374235

42384236
hca_caps = MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability);
4239-
memcpy(hca_caps, MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability),
4240-
MLX5_UN_SZ_BYTES(hca_cap_union));
42414237
MLX5_SET(cmd_hca_cap, hca_caps, roce, enable);
42424238

42434239
err = mlx5_vport_set_other_func_cap(esw->dev, hca_caps, vport_num,

0 commit comments

Comments
 (0)