* [PATCH] media: bcm2835-unicam: Fix a NULL vs IS_ERR() check
@ 2024-05-08 12:31 Dan Carpenter
2024-05-08 15:11 ` Laurent Pinchart
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-05-08 12:31 UTC (permalink / raw)
To: Dave Stevenson
Cc: Mauro Carvalho Chehab, Florian Fainelli,
Broadcom internal kernel review list, Ray Jui, Scott Branden,
Sakari Ailus, Ricardo Ribalda, Laurent Pinchart, Hans Verkuil,
Jean-Michel Hautbois, linux-media, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, kernel-janitors
The media_pad_remote_pad_unique() function returns error pointers, not
NULL. Update the check accordingly.
Fixes: 392cd78d495f ("media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/media/platform/broadcom/bcm2835-unicam.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c
index 3c7878d8d79b..ad55fc930e5b 100644
--- a/drivers/media/platform/broadcom/bcm2835-unicam.c
+++ b/drivers/media/platform/broadcom/bcm2835-unicam.c
@@ -2433,9 +2433,9 @@ static int unicam_async_bound(struct v4l2_async_notifier *notifier,
return ret;
source = media_pad_remote_pad_unique(sink);
- if (!source) {
+ if (IS_ERR(source)) {
dev_err(unicam->dev, "No connected sensor pad\n");
- return -ENOTCONN;
+ return PTR_ERR(source);
}
unicam->sensor.subdev = subdev;
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: bcm2835-unicam: Fix a NULL vs IS_ERR() check
2024-05-08 12:31 [PATCH] media: bcm2835-unicam: Fix a NULL vs IS_ERR() check Dan Carpenter
@ 2024-05-08 15:11 ` Laurent Pinchart
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2024-05-08 15:11 UTC (permalink / raw)
To: Dan Carpenter
Cc: Dave Stevenson, Mauro Carvalho Chehab, Florian Fainelli,
Broadcom internal kernel review list, Ray Jui, Scott Branden,
Sakari Ailus, Ricardo Ribalda, Hans Verkuil,
Jean-Michel Hautbois, linux-media, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, kernel-janitors
Hi Dan,
Thank you for the patch.
On Wed, May 08, 2024 at 03:31:00PM +0300, Dan Carpenter wrote:
> The media_pad_remote_pad_unique() function returns error pointers, not
> NULL. Update the check accordingly.
>
> Fixes: 392cd78d495f ("media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/platform/broadcom/bcm2835-unicam.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c
> index 3c7878d8d79b..ad55fc930e5b 100644
> --- a/drivers/media/platform/broadcom/bcm2835-unicam.c
> +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c
> @@ -2433,9 +2433,9 @@ static int unicam_async_bound(struct v4l2_async_notifier *notifier,
> return ret;
>
> source = media_pad_remote_pad_unique(sink);
> - if (!source) {
> + if (IS_ERR(source)) {
> dev_err(unicam->dev, "No connected sensor pad\n");
> - return -ENOTCONN;
> + return PTR_ERR(source);
> }
>
> unicam->sensor.subdev = subdev;
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-08 15:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-08 12:31 [PATCH] media: bcm2835-unicam: Fix a NULL vs IS_ERR() check Dan Carpenter
2024-05-08 15:11 ` Laurent Pinchart
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).