venus_hfi_destroy() frees hdev and its interface queues before disabling the IRQ. A handler that already loaded core->priv can therefore access freed state even after core->priv is cleared. Move disable_irq() before clearing core->priv and releasing HFI state so both the hard and threaded handlers have completed before teardown. Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") Reported-by: Sashiko Closes: https://lore.kernel.org/all/20260612103333.5585D1F000E9@smtp.kernel.org/ Cc: stable@vger.kernel.org Assisted-by: LLM Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index bd82066bb6e77f68ac3fe1440a8b5429ad62a192..e7e4e78a186adaa7fd80deeb094ed53d54f27ba6 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1689,11 +1689,11 @@ void venus_hfi_destroy(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); + disable_irq(core->irq); core->priv = NULL; venus_interface_queues_release(hdev); mutex_destroy(&hdev->lock); kfree(hdev); - disable_irq(core->irq); core->ops = NULL; } -- 2.53.0