Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] media: imx8-isi: fix resource cleanup issues
@ 2026-05-07  4:13 Xiaolei Wang
  2026-05-07  4:13 ` [PATCH v3 1/4] media: imx8-isi: fix use-after-free on remove Xiaolei Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Xiaolei Wang @ 2026-05-07  4:13 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, Frank.li, s.hauer, kernel, festevam,
	aisheng.dong, jacopo, guoniu.zhou, s.riedmueller, Xiaolei.Wang
  Cc: linux-media, imx, linux-arm-kernel, linux-kernel, stable

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/20260506031210.2769998-1-xiaolei.wang@windriver.com/

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/20260424231926.406079-1-xiaolei.wang@windriver.com/

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(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-05-07  8:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07  4:13 [PATCH v3 0/4] media: imx8-isi: fix resource cleanup issues Xiaolei Wang
2026-05-07  4:13 ` [PATCH v3 1/4] media: imx8-isi: fix use-after-free on remove Xiaolei Wang
2026-05-07  4:13 ` [PATCH v3 2/4] media: imx8-isi: add missing v4l2_subdev_cleanup() in crossbar and pipe Xiaolei Wang
2026-05-07  4:13 ` [PATCH v3 3/4] media: nxp: imx8-isi: Fix missing v4l2_subdev_cleanup() in pipe init error path Xiaolei Wang
2026-05-07  8:37   ` Laurent Pinchart
2026-05-07  4:13 ` [PATCH v3 4/4] media: imx8-isi: clean up already-initialized pipes on probe failure Xiaolei Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox