diff mbox series

[RESEND] drm/i915: add GEM_WARN_ON to remap_io_sg

Message ID g2d547gsiadgmcjqh5rgsqhm4diwk6fmd2hnic5pkatye2zpei@3sjc6v6qj6ex (mailing list archive)
State New
Headers show
Series [RESEND] drm/i915: add GEM_WARN_ON to remap_io_sg | expand

Commit Message

Krzysztof Karas Nov. 21, 2024, 8:53 a.m. UTC
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@intel.com>
---
 drivers/gpu/drm/i915/i915_mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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;