Skip to content

Commit

Permalink
drm/amdkfd: Fix error handling in kfd_criu_restore_events
Browse files Browse the repository at this point in the history
commit 66f7903 upstream.

mutex_unlock before the exit label because all the error code paths that
jump there didn't take that lock. This fixes unbalanced locking errors
in case of restore errors.

Fixes: 40e8a76 ("drm/amdkfd: CRIU checkpoint and restore events")
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
fxkamd authored and gregkh committed Nov 16, 2022
1 parent 182476d commit 0a35e62
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/gpu/drm/amd/amdkfd/kfd_events.c
Expand Up @@ -506,15 +506,14 @@ int kfd_criu_restore_event(struct file *devkfd,
ret = create_other_event(p, ev, &ev_priv->event_id);
break;
}
mutex_unlock(&p->event_mutex);

exit:
if (ret)
kfree(ev);

kfree(ev_priv);

mutex_unlock(&p->event_mutex);

return ret;
}

Expand Down

0 comments on commit 0a35e62

Please sign in to comment.