]> 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)
committerJani Nikula <jani.nikula@intel.com>
Wed, 23 Sep 2020 07:15:46 +0000 (10:15 +0300)
commit19c99e6082561b6e2fc8db36d363d66c62a075ac
treeb238fe5baf5347329f5ad5a5f79e2004e089c490
parent1eb8dd93352288f11ca0e43db3c9c586754c4290
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
(cherry picked from commit 9f9f4101fc98db56714e71676d5a1e2d27e01f7e)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/selftests/mock_gem_device.c