[PATCH v3 0/2] media: atomisp: fix probe memory leaks

From: Dawei Feng

Date: Tue Jun 16 2026 - 09:49:45 EST


This series fixes two memory leaks in the atomisp PCI probe and adjusts
cleanup paths.

Patch 1 fixes the cleanup boundary for media entities created during
module initialization. atomisp_uninitialize_modules() did not release all
module-owned state and instead left some media entity cleanup to unregister
helpers. That split is incomplete for probe failures that happen after
module initialization but before all entities are registered, so the
module cleanup path now owns the corresponding media entity cleanup.

Patch 2 adds cleanup for the V4L2 async notifier state initialized by
atomisp_csi2_bridge_parse_firmware(), including notifier connection
cleanup on probe failures and notifier unregister on remove.

The bug was first flagged by an experimental analysis tool we are
developing for kernel memory-management bugs while analyzing
v6.13-rc1. The tool is still under development and is not yet publicly
available. Manual inspection confirms that the bug is still present in
v7.1-rc7.

An x86_64 allyesconfig build showed no new warnings. As we do not have
an Intel Atom ISP platform with the required camera sensor hardware to
test with, no runtime testing was able to be performed.

Changes in v3:
- Moved the research background and static analysis explanation to the
cover letter.
- Changed Zilin's Signed-off-by to Reported-by.

Dawei Feng (2):
media: atomisp: fix memory leak in atomisp_pci_probe()
media: atomisp: fix memory leak in
atomisp_csi2_bridge_parse_firmware()

.../staging/media/atomisp/pci/atomisp_csi2.c | 5 +++-
.../media/atomisp/pci/atomisp_subdev.c | 9 +++++--
.../staging/media/atomisp/pci/atomisp_v4l2.c | 26 ++++++++++++++-----
3 files changed, 30 insertions(+), 10 deletions(-)

--
2.34.1