]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/selftests: Push the fake iommu device from the stack to data
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 16 Sep 2020 10:50:22 +0000 (11:50 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 16 Sep 2020 19:50:31 +0000 (20:50 +0100)
commit51db5da6f7d77836e15dfeca85d084fc32380da3
tree7473c09172a3e64f946f6010149af3401189d062
parent2c3fc73a264f0b110914fbc353ea42cf49770ec0
drm/i915/selftests: Push the fake iommu device from the stack to data

Since we store a pointer to the fake iommu device that is allocated on
the stack, as soon as we leave the function it goes out of scope and any
future dereference is undefined behaviour. Just in case we may need to
look at the fake iommu device after initialiation, move the allocation
from the stack into the data.

Fixes: 822fdf457072 ("iommu/vt-d: Use dev_iommu_priv_get/set()")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200916105022.28316-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/selftests/mock_gem_device.c