mirror of
https://github.com/torvalds/linux.git
synced 2026-07-29 18:51:21 +02:00
RDMA/mlx5: Fix error propagation in __mlx5_ib_add
__mlx5_ib_add() currently returns -ENOMEM on any stage initialization failure, losing the actual error code returned by the init function. This makes it impossible for callers to distinguish between different failure reasons (e.g. -EINVAL, -EIO, -EOPNOTSUPP) and leads to misleading error handling. Fix it by returning the actual error code stored in 'err'. Link: https://patch.msgid.link/r/20260601095654.2178-1-lirongqing@baidu.com Signed-off-by: Li RongQing <lirongqing@baidu.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
9b2207bc5c
commit
309cacf953
|
|
@ -5116,7 +5116,7 @@ int __mlx5_ib_add(struct mlx5_ib_dev *dev,
|
|||
if (profile->stage[i].cleanup)
|
||||
profile->stage[i].cleanup(dev);
|
||||
}
|
||||
return -ENOMEM;
|
||||
return err;
|
||||
}
|
||||
|
||||
static const struct mlx5_ib_profile pf_profile = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user