[PATCH v2 0/3] media: mediatek: unregister VPU watchdog handlers

From: Guangshuo Li

Date: Mon Jul 20 2026 - 05:01:39 EST


The Mediatek vcodec and MDP drivers register watchdog reset handlers
with the VPU driver and pass driver-owned objects as private data.

These handlers can remain registered after an initialization failure or
device removal. A later VPU watchdog reset can therefore invoke a
handler with stale private data and potentially dereference freed
memory.

This series adds a common helper for unregistering VPU watchdog
handlers, then uses it in the vcodec and MDP cleanup paths before their
VPU device references are released.

The series is organized as follows:

1. Add vpu_wdt_unreg_handler() to the VPU driver.
2. Unregister the vcodec watchdog handler during initialization
failure and firmware release.
3. Unregister the MDP watchdog handler during probe failure and
device removal.

v2:

- Split the changes into three patches as requested by Nicolas.
- Fix the extra blank line reported by checkpatch.
- Carry Nicolas' Reviewed-by tag on the MDP patch.

Guangshuo Li (3):
media: mediatek: vpu: add watchdog handler unregister helper
media: mediatek: vcodec: unregister VPU watchdog handler
media: mtk-mdp: unregister VPU watchdog handler

drivers/media/platform/mediatek/mdp/mtk_mdp_core.c | 2 ++
.../mediatek/vcodec/common/mtk_vcodec_fw_vpu.c | 6 ++++++
drivers/media/platform/mediatek/vpu/mtk_vpu.c | 14 ++++++++++++++
drivers/media/platform/mediatek/vpu/mtk_vpu.h | 2 ++
4 files changed, 24 insertions(+)

--
2.43.0