lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250702-nvdec-dma-error-check-v1-1-c388b402c53a@nvidia.com>
Date: Wed, 02 Jul 2025 11:08:07 +0900
From: Mikko Perttunen <cyndis@...si.fi>
To: Thierry Reding <thierry.reding@...il.com>
Cc: dri-devel@...ts.freedesktop.org, linux-tegra@...r.kernel.org, 
 linux-kernel@...r.kernel.org, Mikko Perttunen <mperttunen@...dia.com>
Subject: [PATCH] drm/tegra: nvdec: Fix dma_alloc_coherent error check

From: Mikko Perttunen <mperttunen@...dia.com>

Check for NULL return value with dma_alloc_coherent, in line with
Robin's fix for vic.c in 'drm/tegra: vic: Fix DMA API misuse'.

Fixes: 46f226c93d35 ("drm/tegra: Add NVDEC driver")
Signed-off-by: Mikko Perttunen <mperttunen@...dia.com>
---
 drivers/gpu/drm/tegra/nvdec.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tegra/nvdec.c b/drivers/gpu/drm/tegra/nvdec.c
index 2d9a0a3f6c381d600189078036b0a5eb3d89d461..7a38664e890e37d163410bced688f4650d6318e9 100644
--- a/drivers/gpu/drm/tegra/nvdec.c
+++ b/drivers/gpu/drm/tegra/nvdec.c
@@ -261,10 +261,8 @@ static int nvdec_load_falcon_firmware(struct nvdec *nvdec)
 
 	if (!client->group) {
 		virt = dma_alloc_coherent(nvdec->dev, size, &iova, GFP_KERNEL);
-
-		err = dma_mapping_error(nvdec->dev, iova);
-		if (err < 0)
-			return err;
+		if (!virt)
+			return -ENOMEM;
 	} else {
 		virt = tegra_drm_alloc(tegra, size, &iova);
 		if (IS_ERR(virt))

---
base-commit: 2aeda9592360c200085898a258c4754bfe879921
change-id: 20250702-nvdec-dma-error-check-effaf7c8341d


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ