Skip to content

Commit e796028

Browse files
ldtsgregkh
authored andcommitted
media: venus: protect against spurious interrupts during probe
commit 3200144 upstream. Make sure the interrupt handler is initialized before the interrupt is registered. If the IRQ is registered before hfi_create(), it's possible that an interrupt fires before the handler setup is complete, leading to a NULL dereference. This error condition has been observed during system boot on Rb3Gen2. Fixes: af2c383 ("[media] media: venus: adding core part and helper functions") Cc: stable@vger.kernel.org Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com> Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com> Tested-by: Dikshita Agarwal <quic_dikshita@quicinc.com> # RB5 Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c957a0a commit e796028

File tree

1 file changed

+4
-4
lines changed
  • drivers/media/platform/qcom/venus

1 file changed

+4
-4
lines changed

drivers/media/platform/qcom/venus/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,13 @@ static int venus_probe(struct platform_device *pdev)
424424
INIT_DELAYED_WORK(&core->work, venus_sys_error_handler);
425425
init_waitqueue_head(&core->sys_err_done);
426426

427-
ret = devm_request_threaded_irq(dev, core->irq, hfi_isr, venus_isr_thread,
428-
IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
429-
"venus", core);
427+
ret = hfi_create(core, &venus_core_ops);
430428
if (ret)
431429
goto err_core_put;
432430

433-
ret = hfi_create(core, &venus_core_ops);
431+
ret = devm_request_threaded_irq(dev, core->irq, hfi_isr, venus_isr_thread,
432+
IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
433+
"venus", core);
434434
if (ret)
435435
goto err_core_put;
436436

0 commit comments

Comments
 (0)