]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Initialize err in remap_io_sg()
authorJosé Roberto de Souza <jose.souza@intel.com>
Mon, 17 May 2021 20:21:17 +0000 (13:21 -0700)
committerJosé Roberto de Souza <jose.souza@intel.com>
Tue, 18 May 2021 18:00:07 +0000 (11:00 -0700)
commit4305aa6a89befdb67468ec956bc81961c84656f8
tree32ec31689dcbb4f130db260d610d0867f1cd1153
parent9471d23d2af0bd24fab67fe97fa2e6402b3c2102
drm/i915: Initialize err in remap_io_sg()

If the do while loop breaks in 'if (!sg_dma_len(sgl))' in the first
iteration, err is uninitialized causing a wrong call to zap_vma_ptes().

But that is impossible to happen as a scatterlist must have at least
one valid segment.
Anyways to avoid more reports from static checkers initializing ret
here.

Fixes: 3e2bb9336005 ("i915: fix remap_io_sg to verify the pgprot")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Ausmus <james.ausmus@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210517202117.179303-1-jose.souza@intel.com
drivers/gpu/drm/i915/i915_mm.c