mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
drm/nouveau/pm: prevent freeing the wrong engine context
This fixes a crash when multiple PM engine contexts are created. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Martin Peres <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
This commit is contained in:
parent
4a8cf4513d
commit
3693d54405
1 changed files with 5 additions and 2 deletions
|
|
@ -332,9 +332,12 @@ static void
|
|||
nvkm_perfctx_dtor(struct nvkm_object *object)
|
||||
{
|
||||
struct nvkm_pm *ppm = (void *)object->engine;
|
||||
struct nvkm_perfctx *ctx = (void *)object;
|
||||
|
||||
mutex_lock(&nv_subdev(ppm)->mutex);
|
||||
nvkm_engctx_destroy(&ppm->context->base);
|
||||
ppm->context = NULL;
|
||||
nvkm_engctx_destroy(&ctx->base);
|
||||
if (ppm->context == ctx)
|
||||
ppm->context = NULL;
|
||||
mutex_unlock(&nv_subdev(ppm)->mutex);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue