media: imx8-isi: fix resource cleanup issues
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest4 patches 1 replyIn review
- v24 patches 7 repliesSuperseded
- v13 patches 4 repliesSuperseded
Changes in v3 from the cover letter
- Dropped the kzalloc_objs() to devm_kcalloc() conversion patch, as there is
ongoing work to add devm_kzalloc_objs(). Will resend once it's available.
- Added patch 3/4 to fix missing v4l2_subdev_cleanup() in pipe init error path.
- Link to V2: https://patchwork.linuxtv.org/project/linux-media/cover/[email protected]/
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | media: imx8-isi: fix use-after-free on removedrivers/ | +1 | 0 replies | |
| 2/4 | media: imx8-isi: add missing v4l2_subdev_cleanup() in crossbar and pipedrivers/ drivers/ | +2 | 0 replies | |
| 3/4 | media: nxp: imx8-isi: Fix missing v4l2_subdev_cleanup() in pipe init error pathdrivers/ | +4 | 1 reply | |
| 4/4 | media: imx8-isi: clean up already-initialized pipes on probe failuredrivers/ | +2 | 0 replies |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Frank Li | Laurent Pinchart |
|---|---|---|
| 1/4 | R-b | R-b |
| 2/4 | R-b | R-b |
| 3/4 | R-b | |
| 4/4 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/4] media: imx8-isi: fix resource cleanup issues
This series fixes several resource management bugs in the imx8-isi driver:
- A use-after-free triggered during rmmod because crossbar pads were freed before media links referencing them were removed.
- A memory leak of subdev active state due to missing v4l2_subdev_cleanup() calls in crossbar and pipe cleanup paths.
- A memory leak of isi->pipes on probe failure and normal unbind.
- Missing cleanup of already-initialized pipes when probe fails partway through the channel loop or during v4l2 init.
All four issues trace back to the original driver introduction in cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver").
Changes in V3:
- Dropped the kzalloc_objs() to devm_kcalloc() conversion patch, as there is
ongoing work to add devm_kzalloc_objs(). Will resend once it's available.
- Added patch 3/4 to fix missing v4l2_subdev_cleanup() in pipe init error path.
- Link to V2: https://patchwork.linuxtv.org/project/linux-media/cover/[email protected]/
Changes in V2:
- Split the previous patch 3 ("media: imx8-isi: fix isi->pipes memory leak
in probe and remove") into two separate patches:
- Patch 3/4: fix isi->pipes memory leak by switching to devm_kcalloc()
- Patch 4/4: clean up already-initialized pipes on probe failure
- Link to V1: https://patchwork.linuxtv.org/project/linux-media/cover/[email protected]/
Xiaolei Wang (4):
media: imx8-isi: fix use-after-free on remove
media: imx8-isi: add missing v4l2_subdev_cleanup() in crossbar and
pipe
media: nxp: imx8-isi: Fix missing v4l2_subdev_cleanup() in pipe init
error path
media: imx8-isi: clean up already-initialized pipes on probe failure
drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 4 +++- drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c | 1 + drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c | 7 +++++-- 3 files changed, 9 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0