@@ -154,7 +154,7 @@ static int mxc_isi_v4l2_init(struct mxc_isi_dev *isi)
if (ret < 0) {
dev_err(isi->dev, "Failed to register pipe%u: %d\n", i,
ret);
- goto err_v4l2;
+ goto err_cleanup_pipe;
}
ret = media_create_pad_link(&isi->crossbar.sd.entity,
@@ -164,14 +164,14 @@ static int mxc_isi_v4l2_init(struct mxc_isi_dev *isi)
MEDIA_LNK_FL_IMMUTABLE |
MEDIA_LNK_FL_ENABLED);
if (ret < 0)
- goto err_v4l2;
+ goto err_cleanup_pipe;
}
/* Register the M2M device. */
ret = mxc_isi_m2m_register(isi, v4l2_dev);
if (ret < 0) {
dev_err(isi->dev, "Failed to register M2M device: %d\n", ret);
- goto err_v4l2;
+ goto err_cleanup_pipe;
}
/* Initialize, fill and register the async notifier. */
@@ -212,6 +212,9 @@ static int mxc_isi_v4l2_init(struct mxc_isi_dev *isi)
err_m2m:
mxc_isi_m2m_unregister(isi);
v4l2_async_nf_cleanup(&isi->notifier);
+err_cleanup_pipe:
+ for (i = 0; i < isi->pdata->num_channels; ++i)
+ mxc_isi_pipe_unregister(&isi->pipes[i]);
err_v4l2:
v4l2_device_unregister(v4l2_dev);
err_media:
mxc_isi_v4l2_init() registers video devices and v4l2 subdevices but the video devices are not cleaned up in that function's error path which means they're left hanging if it fails. Update the function to clean them up properly. Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> --- drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- base-commit: b64b134942c8cf4801ea288b3fd38b509aedec21 change-id: 20250522-djrscally-imx8-isi-fixes-fed2d7cffb1c Best regards,