From 318fd1fe9100eeb0aa227c4ae08a9c0f5c944c93 Mon Sep 17 00:00:00 2001 From: Omar Nemri Date: Wed, 10 Apr 2024 19:26:56 +0000 Subject: [PATCH] drivers: pva: change kmalloc for kvmalloc for elf when loading lf, a local buffer is allocated to process the elf. switch to using kvmalloc from kmalloc to be able to handle memory pressure situations better. Bug 4562933 Change-Id: Ie78d2d2a56f13e09e98bf6888ccc76ffb0ecfb12 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3114106 Reviewed-by: Omar Nemri Tested-by: Omar Nemri Reviewed-by: Jonas Toelke GVS: Gerrit_Virtual_Submit --- drivers/video/tegra/host/pva/pva_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/tegra/host/pva/pva_ioctl.c b/drivers/video/tegra/host/pva/pva_ioctl.c index 2770146c..62f1f75c 100644 --- a/drivers/video/tegra/host/pva/pva_ioctl.c +++ b/drivers/video/tegra/host/pva/pva_ioctl.c @@ -618,7 +618,7 @@ static int pva_register_vpu_exec(struct pva_private *priv, void *arg) int err = 0; data_size = reg_in->exe_data.size; - exec_data = kmalloc(data_size, GFP_KERNEL); + exec_data = kvmalloc(data_size, GFP_KERNEL); if (exec_data == NULL) { nvpva_err(&priv->pva->pdev->dev, "failed to allocate memory for elf"); @@ -671,7 +671,7 @@ static int pva_register_vpu_exec(struct pva_private *priv, void *arg) free_mem: if (exec_data != NULL) - kfree(exec_data); + kvfree(exec_data); out: return err; }