RE: [PATCH v2] PM / devfreq: Stop the governor before device_unregister()

From: MyungJoo Ham
Date: Thu Sep 27 2018 - 01:20:48 EST


> From: Vincent Donnefort <vincent.donnefort@xxxxxxx>
>
> device_release() is freeing the resources before calling the device
> specific release callback which is, in the case of devfreq, stopping
> the governor.
>
> It is a problem as some governors are using the device resources. e.g.
> simpleondemand which is using the devfreq deferrable monitoring work. If it
> is not stopped before the resources are freed, it might lead to a use after
> free.
>
> Signed-off-by: Vincent Donnefort <vincent.donnefort@xxxxxxx>
> Reviewed-by: John Einar Reitan <john.reitan@xxxxxxx>
> Reviewed-by: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>

Acked-by: MyungJoo Ham <myungjoo.ham@xxxxxxxxxxx>


Cheers,
MyungJoo