diff options
author | Qasim Ijaz <qasdev00@gmail.com> | 2025-03-04 17:02:46 +0300 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2025-03-06 11:22:08 +0300 |
commit | 556f93b90c1872ad85e216e613c0b33803e621cb (patch) | |
tree | c2d0d8362836870a9079fc69867d3ffe1c87d622 /tools/perf/scripts/python/task-analyzer.py | |
parent | e8e6087c2f7407dfb8c7592bb6dd533e129b2932 (diff) | |
download | linux-556f93b90c1872ad85e216e613c0b33803e621cb.tar.xz |
RDMA/mlx5: Handle errors returned from mlx5r_ib_rate()
In function create_ib_ah() the following line attempts
to left shift the return value of mlx5r_ib_rate() by 4
and store it in the stat_rate_sl member of av:
However the code overlooks the fact that mlx5r_ib_rate()
may return -EINVAL if the rate passed to it is less than
IB_RATE_2_5_GBPS or greater than IB_RATE_800_GBPS.
Because of this, the code may invoke undefined behaviour when
shifting a signed negative value when doing "-EINVAL << 4".
To fix this check for errors before assigning stat_rate_sl and
propagate any error value to the callers.
Fixes: c534ffda781f ("RDMA/mlx5: Fix AH static rate parsing")
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
Link: https://patch.msgid.link/20250304140246.205919-1-qasdev00@gmail.com
Reviewed-by: Patrisious Haddad <phaddad@nvidia.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions