mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 22:22:08 +02:00
media: amphion: Cancel message work before releasing the VPU core
To avoid accessing the VPU register after release of the VPU core,
cancel the message work and destroy the workqueue that handles the
VPU message before release of the VPU core.
Fixes: 3cd084519c ("media: amphion: add vpu v4l2 m2m support")
Cc: stable@vger.kernel.org
Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
634c2cd17b
commit
ae246b0032
|
|
@ -703,15 +703,15 @@ static int vpu_v4l2_release(struct vpu_inst *inst)
|
|||
{
|
||||
vpu_trace(inst->vpu->dev, "%p\n", inst);
|
||||
|
||||
vpu_release_core(inst->core);
|
||||
put_device(inst->dev);
|
||||
|
||||
if (inst->workqueue) {
|
||||
cancel_work_sync(&inst->msg_work);
|
||||
destroy_workqueue(inst->workqueue);
|
||||
inst->workqueue = NULL;
|
||||
}
|
||||
|
||||
vpu_release_core(inst->core);
|
||||
put_device(inst->dev);
|
||||
|
||||
v4l2_ctrl_handler_free(&inst->ctrl_handler);
|
||||
mutex_destroy(&inst->lock);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user