Skip to content

Commit

Permalink
net/mlx5: Fix a NULL vs IS_ERR() check
Browse files Browse the repository at this point in the history
The mlx5_esw_offloads_devlink_port() function returns error pointers, not
NULL.

Fixes: 7bef147 ("net/mlx5: Don't skip vport check")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Wojciech Drewek <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
  • Loading branch information
Dan Carpenter authored and Saeed Mahameed committed Dec 5, 2023
1 parent 7aaf975 commit ca4ef28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ mlx5e_vport_vf_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)

dl_port = mlx5_esw_offloads_devlink_port(dev->priv.eswitch,
rpriv->rep->vport);
if (dl_port) {
if (!IS_ERR(dl_port)) {
SET_NETDEV_DEVLINK_PORT(netdev, dl_port);
mlx5e_rep_vnic_reporter_create(priv, dl_port);
}
Expand Down

0 comments on commit ca4ef28

Please sign in to comment.