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
This commit is contained in:
Hans Petter Selasky 2023-04-18 13:22:41 +02:00
parent 273bfac08f
commit 95bf70a4bf

View File

@ -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 {