RE: [PATCH v2] driver core: Call dma_cleanup() on the test_remove path

From: Tian, Kevin
Date: Thu Jul 27 2023 - 01:39:37 EST


> From: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Sent: Tuesday, July 25, 2023 1:41 AM
>
> When test_remove is enabled really_probe() does not properly pair
> dma_configure() with dma_remove(), it will end up calling dma_configure()
> twice. This corrupts the owner_cnt and renders the group unusable with
> VFIO/etc.
>
> Add the missing cleanup before going back to re_probe.
>
> Fixes: 25f3bcfc54bc ("driver core: Add dma_cleanup callback in bus_type")
> Reported-by: Zenghui Yu <yuzenghui@xxxxxxxxxx>
> Tested-by: Zenghui Yu <yuzenghui@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/6472f254-c3c4-8610-4a37-
> 8d9dfdd54ce8@xxxxxxxxxx/
> Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>