Skip to content

Commit 0bcd5b3

Browse files
cjubranPaolo Abeni
authored andcommitted
net/mlx5e: Fix missing error assignment in mlx5e_xfrm_add_state()
Assign the return value of mlx5_eswitch_block_mode() to 'err' before checking it to avoid returning an uninitialized error code. Fixes: 22239eb ("net/mlx5e: Prevent tunnel reformat when tunnel mode not allowed") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202510271649.uwsIxD6O-lkp@intel.com/ Closes: http://lore.kernel.org/linux-rdma/aPIEK4rLB586FdDt@stanley.mountain/ Signed-off-by: Carolina Jubran <cjubran@nvidia.com> Reviewed-by: Jianbo Liu <jianbol@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/1762681073-1084058-2-git-send-email-tariqt@nvidia.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 02e9578 commit 0bcd5b3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • drivers/net/ethernet/mellanox/mlx5/core/en_accel

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,8 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
804804
goto err_xfrm;
805805
}
806806

807-
if (mlx5_eswitch_block_mode(priv->mdev))
807+
err = mlx5_eswitch_block_mode(priv->mdev);
808+
if (err)
808809
goto unblock_ipsec;
809810

810811
if (x->props.mode == XFRM_MODE_TUNNEL &&

0 commit comments

Comments
 (0)