From patchwork Tue Dec 5 21:45:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 13480809 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F7E46E2B3 for ; Tue, 5 Dec 2023 21:45:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RfFgimlH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20268C433C7; Tue, 5 Dec 2023 21:45:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701812749; bh=0olGoP/DDNOnO9J0W8cswJ78sOoZ6xFirua5/QysDXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RfFgimlHgefZluenWagXTvUqX8ekZoAPFuVg9Ub3HvSGB0Bv9syG3Oo0z3mvtck/s nYmyrBqs1Dq4hEuSQdIZkEa/QvJ6TS06zPbRa2e39ib7KQ66wFxWjjvvRZCQZ5reNZ /qn6TEuC+bs5ZQINBRMOGzbT8lMPwrAj1RbdVnf2/79hTR2zRJWLY3m7fIkxtcnTAg BX/2b6hqkt8dgYrmaAtYO4sLQTOGW0WteirFazuZjm/QY/iT1cfxFqkA6iRfMKJbC0 36rRMVAdtruuw9rdcUc1ng+MowQ7bIwP4+HlpO4DYrLxrqoGY3oA+pXnuGli9p4yPD LoQlySmsyKiEA== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Dan Carpenter , Wojciech Drewek Subject: [net V3 13/15] net/mlx5: Fix a NULL vs IS_ERR() check Date: Tue, 5 Dec 2023 13:45:32 -0800 Message-ID: <20231205214534.77771-14-saeed@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231205214534.77771-1-saeed@kernel.org> References: <20231205214534.77771-1-saeed@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Dan Carpenter The mlx5_esw_offloads_devlink_port() function returns error pointers, not NULL. Fixes: 7bef147a6ab6 ("net/mlx5: Don't skip vport check") Signed-off-by: Dan Carpenter Reviewed-by: Wojciech Drewek Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index 3ab682bbcf86..1bf7540a65ad 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -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); }