Re: [PATCH v2] dmaengine: idxd: fix double free in idxd_alloc() error path

From: Vinicius Costa Gomes

Date: Wed Apr 29 2026 - 17:12:38 EST


Guangshuo Li <lgs201920130244@xxxxxxxxx> writes:

> Hi Vinicius,
>
> Thanks for reviewing.
>
> On Thu, 23 Apr 2026 at 05:56, Vinicius Costa Gomes
> <vinicius.gomes@xxxxxxxxx> wrote:
>>
>> On the review of 'v1', you agreed to the comments I made, but they are
>> neither reflected in the code nor in the series organization.
>>
>
> You're right — my v2 did not incorporate the broader issues you pointed out.
>
> At the moment I don't have a good fix for the similar patterns in
> idxd_clean_wqs(), idxd_clean_engines(), idxd_clean_groups(), and
> idxd_free(). Do you have any suggestion on the preferred way to
> restructure those cleanup paths?
>

The idea is that the explicit free's
(kfree()/bitmap_free()/ida_free()/etc) should be removed and instead
rely on device_put() doing the right thing on the _release() path.

Just not sure if we need to check that the workqueue was already created
before calling destroy_workqueue().


Cheers,
--
Vinicius