Re: [PATCH] driver core: Postpone DMA tear-down until after devres release for probe failure

From: John Garry
Date: Thu Apr 11 2019 - 08:13:24 EST


On 11/04/2019 12:01, Robin Murphy wrote:

The crash occurs for the same reason.

In this case, on the really_probe() failure path, we are still
clearing
the DMA ops prior to releasing the device's managed memories.

This patch fixes this issue by reordering the DMA ops teardown
and the
call to devres_release_all() on the failure path.

Reported-by: Xiang Chen <chenxiang66@xxxxxxxxxxxxx>
Tested-by: Xiang Chen <chenxiang66@xxxxxxxxxxxxx>
Signed-off-by: John Garry <john.garry@xxxxxxxxxx>

So does this "fix" 376991db4b64? If so, should this be added to the
patch and also backported to the stable trees?

Hi Greg,

No, I don't think so. I'd say it supplements it. Here I'm trying to fix
up another path in which we tear down the DMA ops prior to releasing
the
device's resources.

I didn't add a fixes tag as 376991db4b64 didn't have one either. It
will
need to be backported to stable, I figure the same as 376991db4b64.


Hi Greg,

I still think that we should consider merging this patch.

Bah, sorry, I thought I'd replied to this thread already, but apparently
not :(

I don't have a particularly strong opinion, but at the moment I am
leaning slightly towards this being a parallel fix for another part of
09515ef5ddad, rather than a specific fix of the other fix. Either way,
you can have a:

I'd say a parallel fix of 09515ef5ddad.


Reviewed-by: Robin Murphy <robin.murphy@xxxxxxx>


cheers Robin

Thanks,
Robin.