Re: [PATCH v5 1/2] media: venus: hfi: disable IRQ before freeing HFI device
From: Vishnu Reddy
Date: Tue Dec 01 2026 - 03:56:05 EST
On 10/24/2026 8:10 AM, 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")
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/20260612103333.5585D1F000E9@xxxxxxxxxxxxxxx/
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: LLM
Checkpatch reports an error for the Assisted-by: LLM tag:
WARNING: Non-standard signature: Assisted-by:
#18:
Assisted-by: LLM
ERROR: Unrecognized email address: 'LLM'
#18:
Assisted-by: LLM
total: 1 errors, 1 warnings, 0 checks, 12 lines checked
> 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;
> }
>