Re: [PATCH v5 1/2] media: venus: hfi: disable IRQ before freeing HFI device
From: bod
Date: Tue Nov 17 2026 - 06:22:37 EST
On 2026-10-23 22:40 -0400, Myeonghun Pak wrote:
> 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")
Fixes: 640803003cd9 ("media: venus: hfi: explicitly release IRQ during teardown")
No need to resend, I'll fix this tag too.
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/20260612103333.5585D1F000E9@xxxxxxxxxxxxxxx/
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: LLM
> Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>
> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
> ---
> 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
>
>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
---
bod