[PATCH] drm/i915: add GEM_WARN_ON to remap_io_sg

Krzysztof Karas krzysztof.karas at intel.com
Fri Oct 25 10:57:35 UTC 2024


Since we already have that warning inside `remap_sg` we can also catch
this condition inside `remap_io_sg`.

Signed-off-by: Krzysztof Karas <krzysztof.karas at intel.com>
---
 drivers/gpu/drm/i915/i915_mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
index f5c97a620962..8a2779191f18 100644
--- a/drivers/gpu/drm/i915/i915_mm.c
+++ b/drivers/gpu/drm/i915/i915_mm.c
@@ -146,7 +146,7 @@ int remap_io_sg(struct vm_area_struct *vma,
 	while (offset >= sg_dma_len(r.sgt.sgp) >> PAGE_SHIFT) {
 		offset -= sg_dma_len(r.sgt.sgp) >> PAGE_SHIFT;
 		r.sgt = __sgt_iter(__sg_next(r.sgt.sgp), use_dma(iobase));
-		if (!r.sgt.sgp)
+		if (GEM_WARN_ON(!r.sgt.sgp))
 			return -EINVAL;
 	}
 	r.sgt.curr = offset << PAGE_SHIFT;
-- 
2.43.0



More information about the Intel-gfx mailing list