public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Xiaolei Wang <xiaolei.wang@windriver.com>
To: laurent.pinchart@ideasonboard.com, mchehab@kernel.org,
	Frank.li@nxp.com, s.hauer@pengutronix.de, kernel@pengutronix.de,
	festevam@gmail.com, aisheng.dong@nxp.com, jacopo@jmondi.org,
	guoniu.zhou@nxp.com, s.riedmueller@phytec.de,
	Xiaolei.Wang@windriver.com
Cc: linux-media@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH v2 0/4] media: imx8-isi: fix resource cleanup issues
Date: Wed,  6 May 2026 11:12:06 +0800	[thread overview]
Message-ID: <20260506031210.2769998-1-xiaolei.wang@windriver.com> (raw)

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 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: imx8-isi: fix isi->pipes memory leak in probe and remove
  media: imx8-isi: clean up already-initialized pipes on probe failure

 drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c     | 7 +++++--
 drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c | 1 +
 drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c     | 1 +
 3 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.43.0



             reply	other threads:[~2026-05-06  3:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06  3:12 Xiaolei Wang [this message]
2026-05-06  3:12 ` [PATCH v2 1/4] media: imx8-isi: fix use-after-free on remove Xiaolei Wang
2026-05-06 12:31   ` Laurent Pinchart
2026-05-06  3:12 ` [PATCH v2 2/4] media: imx8-isi: add missing v4l2_subdev_cleanup() in crossbar and pipe Xiaolei Wang
2026-05-06 12:35   ` Laurent Pinchart
2026-05-06 14:23     ` xiaolei wang
2026-05-06  3:12 ` [PATCH v2 3/4] media: imx8-isi: fix isi->pipes memory leak in probe and remove Xiaolei Wang
2026-05-06 12:41   ` Laurent Pinchart
2026-05-06 14:29     ` xiaolei wang
2026-05-06  3:12 ` [PATCH v2 4/4] media: imx8-isi: clean up already-initialized pipes on probe failure Xiaolei Wang
2026-05-06 14:19   ` Laurent Pinchart
2026-05-06 14:25   ` Frank Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260506031210.2769998-1-xiaolei.wang@windriver.com \
    --to=xiaolei.wang@windriver.com \
    --cc=Frank.li@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=festevam@gmail.com \
    --cc=guoniu.zhou@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=jacopo@jmondi.org \
    --cc=kernel@pengutronix.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=s.riedmueller@phytec.de \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox