]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net/mlx5: Fix function calculation for page trees
authorDaniel Jurgens <danielj@nvidia.com>
Mon, 1 Feb 2021 16:11:10 +0000 (18:11 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 2 Feb 2021 07:02:01 +0000 (23:02 -0800)
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>
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c

index eaa8958e24d79f69556dbec7462e1a9b837fe79b..c0656d4782e1c3bc3d5b63091fb21eb13f6d63ba 100644 (file)
@@ -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)