From patchwork Wed Nov 22 01:48:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 13463860 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 469D7F9F9 for ; Wed, 22 Nov 2023 01:48:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qJNWcYaR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0CF1C433C9; Wed, 22 Nov 2023 01:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700617698; bh=GNYYcPy4xsznC/cMS/cnFrKSsdoSIpGKYTrq+xEqd3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qJNWcYaRj2FXDXHBAYuq/lZZ7sGtbhbwhsrP1/Yi/71XnuG+sUPCvxHonae1fnI0s l5t3TyVSkOncYsBl5uscA3v5s3TLZX07xRJQE8eOYU5qwtuluQfLmiWHdkHUKsf61D n0FcZGuTpBiEOlV9ostREe2vzhDqIuO8juyktIRKI964xiwV9wRFmEUynMJnxsxd5Q Zn1x7CDy4aeBDaT/IPxkZSQJwQdB8o7hju/VYaRdPmtgxc1R7JbpdC8krqQ2R+BFD7 4fKmLVZEmw+ERIx6LyzmCrrLTMRdbsRtSYNOkE1jeISgrQQCJCFiycXMDZflgx42fQ j4U8wunEtqD4Q== 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 15/15] net/mlx5: Fix a NULL vs IS_ERR() check Date: Tue, 21 Nov 2023 17:48:04 -0800 Message-ID: <20231122014804.27716-16-saeed@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231122014804.27716-1-saeed@kernel.org> References: <20231122014804.27716-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); }