diff options
author | Daniel Jurgens <danielj@nvidia.com> | 2021-02-01 19:11:10 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2021-02-02 10:02:01 +0300 |
commit | ed5e83a3c02948dad9dc4e68fb4e535baa5da630 (patch) | |
tree | df67283cecf8c5ba8a81c67bca3bf99a18370d50 /drivers/net | |
parent | 188fa104f2ba93887777ded2e600ce16d60bc3d7 (diff) | |
download | linux-ed5e83a3c02948dad9dc4e68fb4e535baa5da630.tar.xz |
net/mlx5: Fix function calculation for page trees
The function calculation always results in a value of 0. This works
generally, but when the release all pages feature is enabled it will
result in crashes.
Fixes: 0aa128475d33 ("net/mlx5: Maintain separate page trees for ECPF and PF functions")
Signed-off-by: Daniel Jurgens <danielj@nvidia.com>
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c index eaa8958e24d7..c0656d4782e1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c @@ -76,7 +76,7 @@ enum { static u32 get_function(u16 func_id, bool ec_function) { - return func_id & (ec_function << 16); + return (u32)func_id | (ec_function << 16); } static struct rb_root *page_root_per_function(struct mlx5_core_dev *dev, u32 function) |