aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mlx5/mlx5_core
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2023-04-18 11:22:41 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2023-04-18 13:01:06 +0000
commit95bf70a4bf7982091bb59200bc2db2cb5cd840d7 (patch)
tree027bf60a9e3fd27f7b6a92522c9bb4471d573390 /sys/dev/mlx5/mlx5_core
parent273bfac08ff838786c8b48bc7d3d7180b5f6a3be (diff)
mlx5: Don't give zero number of pages to the firmware.
Can happen when using virtual mlx5_core<N> functions, VFs. MFC after: 1 week Sponsored by: NVIDIA Networking
Diffstat (limited to 'sys/dev/mlx5/mlx5_core')
-rw-r--r--sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c b/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c
index d298da67057a..730c7ee8bee9 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c
@@ -509,7 +509,10 @@ int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot)
mlx5_core_dbg(dev, "requested %d %s pages for func_id 0x%x\n",
npages, boot ? "boot" : "init", func_id);
- return give_pages(dev, func_id, npages, 0);
+ if (npages > 0)
+ return give_pages(dev, func_id, npages, 0);
+ else
+ return 0;
}
enum {