* [PATCH next] media: ti: j721e-csi2rx: Fix NULL vs IS_ERR() bug in ti_csi2rx_request_max_ppc()
@ 2025-08-27 13:02 Dan Carpenter
2025-08-27 14:09 ` Jai Luthra
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-08-27 13:02 UTC (permalink / raw)
To: Jai Luthra
Cc: Jai Luthra, Mauro Carvalho Chehab, Sakari Ailus, Hans Verkuil,
linux-media, linux-kernel, kernel-janitors
The media_entity_remote_source_pad_unique() function never returns NULL,
it returns error pointers. Change this check from a NULL check to an
IS_ERR() check.
Fixes: 31f91c5224cd ("media: ti: j721e-csi2rx: Support multiple pixels per clock")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
index 3992f8b754b7..b75aa363d1bf 100644
--- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
+++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
@@ -497,7 +497,7 @@ static void ti_csi2rx_request_max_ppc(struct ti_csi2rx_dev *csi)
int ret;
pad = media_entity_remote_source_pad_unique(&csi->vdev.entity);
- if (!pad)
+ if (IS_ERR(pad))
return;
ret = cdns_csi2rx_negotiate_ppc(csi->source, pad->index, &ppc);
--
2.47.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH next] media: ti: j721e-csi2rx: Fix NULL vs IS_ERR() bug in ti_csi2rx_request_max_ppc()
2025-08-27 13:02 [PATCH next] media: ti: j721e-csi2rx: Fix NULL vs IS_ERR() bug in ti_csi2rx_request_max_ppc() Dan Carpenter
@ 2025-08-27 14:09 ` Jai Luthra
0 siblings, 0 replies; 2+ messages in thread
From: Jai Luthra @ 2025-08-27 14:09 UTC (permalink / raw)
To: Dan Carpenter
Cc: Jai Luthra, Mauro Carvalho Chehab, Sakari Ailus, Hans Verkuil,
linux-media, linux-kernel, kernel-janitors
Hi Dan,
Quoting Dan Carpenter (2025-08-27 18:32:57)
> The media_entity_remote_source_pad_unique() function never returns NULL,
> it returns error pointers. Change this check from a NULL check to an
> IS_ERR() check.
>
> Fixes: 31f91c5224cd ("media: ti: j721e-csi2rx: Support multiple pixels per clock")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> index 3992f8b754b7..b75aa363d1bf 100644
> --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> @@ -497,7 +497,7 @@ static void ti_csi2rx_request_max_ppc(struct ti_csi2rx_dev *csi)
> int ret;
>
> pad = media_entity_remote_source_pad_unique(&csi->vdev.entity);
> - if (!pad)
> + if (IS_ERR(pad))
Argh, my bad. Thanks for the quick fix.
Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>
> return;
>
> ret = cdns_csi2rx_negotiate_ppc(csi->source, pad->index, &ppc);
> --
> 2.47.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-27 14:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-27 13:02 [PATCH next] media: ti: j721e-csi2rx: Fix NULL vs IS_ERR() bug in ti_csi2rx_request_max_ppc() Dan Carpenter
2025-08-27 14:09 ` Jai Luthra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).