Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: ti: j721e-csi2rx: Fix NULL vs IS_ERR() bug in ti_csi2rx_request_max_ppc()

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>

authored by

Dan Carpenter and committed by
Mauro Carvalho Chehab
80ae11c1 a1dcf9a0

+1 -1
+1 -1
drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
··· 497 497 int ret; 498 498 499 499 pad = media_entity_remote_source_pad_unique(&csi->vdev.entity); 500 - if (!pad) 500 + if (IS_ERR(pad)) 501 501 return; 502 502 503 503 ret = cdns_csi2rx_negotiate_ppc(csi->source, pad->index, &ppc);