]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: ti: j721e-csi2rx: Fix NULL vs IS_ERR() bug in ti_csi2rx_request_max_ppc()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 27 Aug 2025 13:02:57 +0000 (16:02 +0300)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 9 Sep 2025 13:59:16 +0000 (15:59 +0200)
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")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c

index 3992f8b754b75f22fffe14c53a338ed8d79d5f84..b75aa363d1bf25f8c31b403c3aede0b31333c56b 100644 (file)
@@ -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);