kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2 net-next] net/mlx5e: TC: Fix IS_ERR() vs NULL checks
@ 2020-09-28 17:41 Dan Carpenter
  2020-09-28 17:42 ` [PATCH 2/2 net-next] net/mlx5e: TC: Fix potential Oops in mlx5e_tc_unoffload_from_slow_path() Dan Carpenter
  2020-09-28 18:31 ` [PATCH 1/2 net-next] net/mlx5e: TC: Fix IS_ERR() vs NULL checks Ariel Levkovich
  0 siblings, 2 replies; 7+ messages in thread
From: Dan Carpenter @ 2020-09-28 17:41 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: Leon Romanovsky, David S. Miller, Jakub Kicinski, Roi Dayan,
	Ariel Levkovich, netdev, linux-rdma, kernel-janitors

The mlx5_tc_ct_init() function doesn't return error pointers it returns
NULL.  Also we need to set the error codes on this path.

Fixes: aedd133d17bc ("net/mlx5e: Support CT offload for tc nic flows")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 104b1c339de0..438fbcf478d1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -5224,8 +5224,10 @@ int mlx5e_tc_nic_init(struct mlx5e_priv *priv)
 
 	tc->ct = mlx5_tc_ct_init(priv, tc->chains, &priv->fs.tc.mod_hdr,
 				 MLX5_FLOW_NAMESPACE_KERNEL);
-	if (IS_ERR(tc->ct))
+	if (!tc->ct) {
+		err = -ENOMEM;
 		goto err_ct;
+	}
 
 	tc->netdevice_nb.notifier_call = mlx5e_tc_netdev_event;
 	err = register_netdevice_notifier_dev_net(priv->netdev,
@@ -5300,8 +5300,10 @@ int mlx5e_tc_esw_init(struct rhashtable *tc_ht)
 					       esw_chains(esw),
 					       &esw->offloads.mod_hdr,
 					       MLX5_FLOW_NAMESPACE_FDB);
-	if (IS_ERR(uplink_priv->ct_priv))
+	if (!uplink_priv->ct_priv) {
+		err = -ENOMEM;
 		goto err_ct;
+	}
 
 	mapping = mapping_create(sizeof(struct tunnel_match_key),
 				 TUNNEL_INFO_BITS_MASK, true);
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-02-16 21:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28 17:41 [PATCH 1/2 net-next] net/mlx5e: TC: Fix IS_ERR() vs NULL checks Dan Carpenter
2020-09-28 17:42 ` [PATCH 2/2 net-next] net/mlx5e: TC: Fix potential Oops in mlx5e_tc_unoffload_from_slow_path() Dan Carpenter
2020-09-28 18:31 ` [PATCH 1/2 net-next] net/mlx5e: TC: Fix IS_ERR() vs NULL checks Ariel Levkovich
2020-09-28 18:51   ` Dan Carpenter
2021-02-15  8:30   ` Dan Carpenter
2021-02-16 21:37     ` Saeed Mahameed
2021-02-16 21:37       ` Saeed Mahameed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).