[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251014064420.11-1-alsp705@gmail.com>
Date: Tue, 14 Oct 2025 09:44:16 +0300
From: Alexandr Sapozhnikov <alsp705@...il.com>
To: Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Tvrtko Ursulin <tursulin@...ulin.net>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>
Cc: Alexandr Sapozhnikov <alsp705@...il.com>,
intel-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org,
lvc-project@...uxtesting.org
Subject: [PATCH v2] drm/i915/gem: handle drm_vma_node_allow_once() return value
Add missing return value handling of drm_vma_node_allow_once()
since the failure to insert the file tag for the node should
indicate the whole mmap_offset_attach() failed as well.
v2: update changelog and return error directly as Chris Wilson,
Andi Shyti and Ville Syrjala suggested.
link to v1: https://lore.kernel.org/all/20251002084828.11-1-alsp705@gmail.com/
Found by Linux Verification Center (linuxtesting.org) with svace.
Signed-off-by: Alexandr Sapozhnikov <alsp705@...il.com>
---
drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index 75f5b0e871ef..eb76f8f2bd95 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -758,8 +758,11 @@ mmap_offset_attach(struct drm_i915_gem_object *obj,
mmo = insert_mmo(obj, mmo);
GEM_BUG_ON(lookup_mmo(obj, mmap_type) != mmo);
out:
- if (file)
- drm_vma_node_allow_once(&mmo->vma_node, file);
+ if (file) {
+ err = drm_vma_node_allow_once(&mmo->vma_node, file);
+ if (err)
+ return ERR_PTR(err);
+ }
return mmo;
err:
--
2.43.0
Powered by blists - more mailing lists