Module Name: src Committed By: riastradh Date: Sun Dec 19 12:35:13 UTC 2021
Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_ggtt.c Log Message: i915: Terminate inner loop if we hit end of view. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c:1.14 src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c:1.15 --- src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c:1.14 Sun Dec 19 12:35:04 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c Sun Dec 19 12:35:13 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_ggtt.c,v 1.14 2021/12/19 12:35:04 riastradh Exp $ */ +/* $NetBSD: intel_ggtt.c,v 1.15 2021/12/19 12:35:13 riastradh Exp $ */ // SPDX-License-Identifier: MIT /* @@ -6,7 +6,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: intel_ggtt.c,v 1.14 2021/12/19 12:35:04 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_ggtt.c,v 1.15 2021/12/19 12:35:13 riastradh Exp $"); #include <linux/stop_machine.h> @@ -1669,7 +1669,10 @@ intel_partial_pages(const struct i915_gg offset -= iseg->ds_len; continue; } - for (k = 0; k < iseg->ds_len >> PAGE_SHIFT; k++) { + for (k = 0; + (i < view->partial.size && + k < iseg->ds_len >> PAGE_SHIFT); + k++) { KASSERT(i < view->partial.size); bus_dma_segment_t *oseg = &st->sgl->sg_dmamap->dm_segs[i++];