linux/drivers/hwtracing/intel_th
Alexander Shishkin 0ed2424b91 intel_th: Use correct device when freeing buffers
Commit d5c435df4a ("intel_th: msu: Use the real device in case of IOMMU
domain allocation") changes dma buffer allocation to use the actual
underlying device, but forgets to change the deallocation path, which leads
to (if you've got CAP_SYS_RAWIO):

> # echo 0,0 > /sys/bus/intel_th/devices/0-msc0/nr_pages
> ------------[ cut here ]------------
> kernel BUG at ../linux/drivers/iommu/intel-iommu.c:3670!
> CPU: 3 PID: 231 Comm: sh Not tainted 4.17.0-rc1+ #2729
> RIP: 0010:intel_unmap+0x11e/0x130
...
> Call Trace:
>  intel_free_coherent+0x3e/0x60
>  msc_buffer_win_free+0x100/0x160 [intel_th_msu]

This patch fixes the buffer deallocation code to use the correct device.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Fixes: d5c435df4a ("intel_th: msu: Use the real device in case of IOMMU domain allocation")
Reported-by: Baofeng Tian <baofeng.tian@intel.com>
CC: stable@vger.kernel.org # v4.14+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25 18:09:17 +02:00
..
acpi.c intel_th: Add ACPI glue layer 2018-03-28 18:47:23 +03:00
core.c intel_th: Allow forcing host mode through drvdata 2018-03-28 18:47:21 +03:00
debug.c intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00
debug.h intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00
gth.c intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00
gth.h intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00
intel_th.h intel_th: Allow forcing host mode through drvdata 2018-03-28 18:47:21 +03:00
Kconfig intel_th: Add ACPI glue layer 2018-03-28 18:47:23 +03:00
Makefile intel_th: Add ACPI glue layer 2018-03-28 18:47:23 +03:00
msu.c intel_th: Use correct device when freeing buffers 2018-05-25 18:09:17 +02:00
msu.h intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00
pci.c intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00
pti.c intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00
pti.h intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00
sth.c intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00
sth.h intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00