linux-stable/drivers/dma/idxd
Harshit Mogalapalli 0642287e3e dmaengine: idxd: Fix passing freed memory in idxd_cdev_open()
Smatch warns:
	drivers/dma/idxd/cdev.c:327:
		idxd_cdev_open() warn: 'sva' was already freed.

When idxd_wq_set_pasid() fails, the current code unbinds sva and then
goes to 'failed_set_pasid' where iommu_sva_unbind_device is called
again causing the above warning.
[ device_user_pasid_enabled(idxd) is still true when calling
failed_set_pasid ]

Fix this by removing additional unbind when idxd_wq_set_pasid() fails

Fixes: b022f59725 ("dmaengine: idxd: add idxd_copy_cr() to copy user completion record during page fault handling")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20230509060716.2830630-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2023-05-17 12:15:09 +05:30
..
Makefile dmanegine: idxd: add debugfs for event log dump 2023-04-12 23:18:45 +05:30
bus.c Bus: Make remove callback return void tag 2021-07-27 19:12:14 +05:30
cdev.c dmaengine: idxd: Fix passing freed memory in idxd_cdev_open() 2023-05-17 12:15:09 +05:30
compat.c dmaengine: idxd: use const struct bus_type * 2023-03-23 13:21:42 +01:00
debugfs.c dmanegine: idxd: add debugfs for event log dump 2023-04-12 23:18:45 +05:30
device.c dmaengine updates for v6.4 2023-05-03 11:11:56 -07:00
dma.c dmaengine: idxd: Remove the unused function set_completion_address() 2022-12-28 12:29:06 +05:30
idxd.h dmaengine updates for v6.4 2023-05-03 11:11:56 -07:00
init.c dmaengine updates for v6.4 2023-05-03 11:11:56 -07:00
irq.c dmaengine updates for v6.4 2023-05-03 11:11:56 -07:00
perfmon.c dmaengine: idxd: Add IDXD performance monitor support 2021-04-25 21:46:12 +05:30
perfmon.h dmaengine: idxd: Add IDXD performance monitor support 2021-04-25 21:46:12 +05:30
registers.h dmaengine: idxd: add per wq PRS disable 2023-04-12 23:18:46 +05:30
submit.c dmaengine: idxd: fix retry value to be constant for duration of function call 2022-04-20 17:24:42 +05:30
sysfs.c dmaengine: idxd: add per wq PRS disable 2023-04-12 23:18:46 +05:30