summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorChen Ni <nichen@iscas.ac.cn>2026-05-22 09:57:34 +0800
committerSakari Ailus <sakari.ailus@linux.intel.com>2026-05-28 21:25:38 +0300
commitf368ded872292b01d29d6f1e4a98746f3432c991 (patch)
tree66f8e3c992e569afd119f137d301c9a2a4b39f42 /drivers/media
parent6767653b4e633d0ceaaaa734a4692306a9970573 (diff)
media: ti: j721e-csi2rx: Fix error handling for media_entity_remote_source_pad_unique()
The media_entity_remote_source_pad_unique() function returns an error pointer on failure, not NULL. Fix the check to use IS_ERR() and return PTR_ERR() to correctly handle allocation failures. Fixes: 982135c0eac6 ("media: ti: j721e-csi2rx: add a subdev for the core device") Fixes: 3ed9c0a1fdba ("media: ti: j721e-csi2rx: add multistream support") Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
index ef74e2da19b6..4769931b1930 100644
--- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
+++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
@@ -887,9 +887,9 @@ static int ti_csi2rx_get_stream(struct ti_csi2rx_ctx *ctx)
/* Get the source pad connected to this ctx */
pad = media_entity_remote_source_pad_unique(ctx->pad.entity);
- if (!pad) {
+ if (IS_ERR(pad)) {
dev_err(csi->dev, "No pad connected to ctx %d\n", ctx->idx);
- return -ENODEV;
+ return PTR_ERR(pad);
}
state = v4l2_subdev_get_locked_active_state(&csi->subdev);
@@ -1183,8 +1183,8 @@ static int ti_csi2rx_sd_enable_streams(struct v4l2_subdev *sd,
spin_unlock_irqrestore(&dma->lock, flags);
remote_pad = media_entity_remote_source_pad_unique(&csi->subdev.entity);
- if (!remote_pad)
- return -ENODEV;
+ if (IS_ERR(remote_pad))
+ return PTR_ERR(remote_pad);
sink_streams = v4l2_subdev_state_xlate_streams(state, pad,
TI_CSI2RX_PAD_SINK,
&streams_mask);
@@ -1218,8 +1218,8 @@ static int ti_csi2rx_sd_disable_streams(struct v4l2_subdev *sd,
writel(0, csi->shim + SHIM_CNTL);
remote_pad = media_entity_remote_source_pad_unique(&csi->subdev.entity);
- if (!remote_pad)
- return -ENODEV;
+ if (IS_ERR(remote_pad))
+ return PTR_ERR(remote_pad);
sink_streams = v4l2_subdev_state_xlate_streams(state, pad,
TI_CSI2RX_PAD_SINK,
&streams_mask);