Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] media: staging/imx: Missing assignment in imx_media_capture_device_register()
@ 2020-02-11  7:35 Dan Carpenter
  2020-02-11 18:10 ` Steve Longerbeam
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-02-11  7:35 UTC (permalink / raw)
  To: Steve Longerbeam
  Cc: Philipp Zabel, Mauro Carvalho Chehab, Greg Kroah-Hartman,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Hans Verkuil, linux-media, kernel-janitors

There was supposed to be a "ret = " assignment here, otherwise the
error handling on the next line won't work.

Fixes: 64b5a49df486 ("[media] media: imx: Add Capture Device Interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Not tested.  Sometimes in these situations the function could be
returning something bogus but no one knew because the assignment wasn't
there.  So it's best to test these.

 drivers/staging/media/imx/imx-media-capture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c
index 7712e7be8625..df0bf680721b 100644
--- a/drivers/staging/media/imx/imx-media-capture.c
+++ b/drivers/staging/media/imx/imx-media-capture.c
@@ -778,7 +778,7 @@ int imx_media_capture_device_register(struct imx_media_video_dev *vdev)
 	/* setup default format */
 	fmt_src.pad = priv->src_sd_pad;
 	fmt_src.which = V4L2_SUBDEV_FORMAT_ACTIVE;
-	v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt_src);
+	ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt_src);
 	if (ret) {
 		v4l2_err(sd, "failed to get src_sd format\n");
 		goto unreg;
-- 
2.11.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: staging/imx: Missing assignment in imx_media_capture_device_register()
  2020-02-11  7:35 [PATCH] media: staging/imx: Missing assignment in imx_media_capture_device_register() Dan Carpenter
@ 2020-02-11 18:10 ` Steve Longerbeam
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Longerbeam @ 2020-02-11 18:10 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Philipp Zabel, Mauro Carvalho Chehab, Greg Kroah-Hartman,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Hans Verkuil, linux-media, kernel-janitors

Thanks for catching. Tested on a imx6 sabreauto and it's fine.

On 2/10/20 11:35 PM, Dan Carpenter wrote:
> There was supposed to be a "ret = " assignment here, otherwise the
> error handling on the next line won't work.
>
> Fixes: 64b5a49df486 ("[media] media: imx: Add Capture Device Interface")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Steve Longerbeam <slongerbeam@gmail.com>

> ---
> Not tested.  Sometimes in these situations the function could be
> returning something bogus but no one knew because the assignment wasn't
> there.  So it's best to test these.
>
>   drivers/staging/media/imx/imx-media-capture.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c
> index 7712e7be8625..df0bf680721b 100644
> --- a/drivers/staging/media/imx/imx-media-capture.c
> +++ b/drivers/staging/media/imx/imx-media-capture.c
> @@ -778,7 +778,7 @@ int imx_media_capture_device_register(struct imx_media_video_dev *vdev)
>   	/* setup default format */
>   	fmt_src.pad = priv->src_sd_pad;
>   	fmt_src.which = V4L2_SUBDEV_FORMAT_ACTIVE;
> -	v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt_src);
> +	ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt_src);
>   	if (ret) {
>   		v4l2_err(sd, "failed to get src_sd format\n");
>   		goto unreg;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11  7:35 [PATCH] media: staging/imx: Missing assignment in imx_media_capture_device_register() Dan Carpenter
2020-02-11 18:10 ` Steve Longerbeam

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git