mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
media: nxp: imx8-isi: Fix missing v4l2_subdev_cleanup() in pipe init error path
After v4l2_subdev_init_finalize() succeeds in mxc_isi_pipe_init(), if
platform_get_irq() or devm_request_irq() fails, the error path jumps to
a label that only calls media_entity_cleanup() and mutex_destroy(),
missing the v4l2_subdev_cleanup() call needed to free the subdev active
state allocated by v4l2_subdev_init_finalize().
Add an error_subdev label that calls v4l2_subdev_cleanup() before
falling through to the existing error cleanup.
Fixes: cf21f328fc ("media: nxp: Add i.MX8 ISI driver")
Cc: stable@vger.kernel.org
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patch.msgid.link/20260507041318.491594-4-xiaolei.wang@windriver.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
567418eedd
commit
8262de0663
|
|
@ -796,18 +796,20 @@ int mxc_isi_pipe_init(struct mxc_isi_dev *isi, unsigned int id)
|
|||
irq = platform_get_irq(to_platform_device(isi->dev), id);
|
||||
if (irq < 0) {
|
||||
ret = irq;
|
||||
goto error;
|
||||
goto error_subdev;
|
||||
}
|
||||
|
||||
ret = devm_request_irq(isi->dev, irq, mxc_isi_pipe_irq_handler,
|
||||
0, dev_name(isi->dev), pipe);
|
||||
if (ret < 0) {
|
||||
dev_err(isi->dev, "failed to request IRQ (%d)\n", ret);
|
||||
goto error;
|
||||
goto error_subdev;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error_subdev:
|
||||
v4l2_subdev_cleanup(sd);
|
||||
error:
|
||||
media_entity_cleanup(&sd->entity);
|
||||
mutex_destroy(&pipe->lock);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user