From c7b5b7570476d8207a364e4d3625537078d3ba1f Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 18 Mar 2022 14:56:57 +0200 Subject: Return an error status when capture fails The video_do_capture() function overrides the error code when a failure occurs. This prevents returning an error status to the calling process. Fix it. Signed-off-by: Laurent Pinchart --- yavta.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yavta.c b/yavta.c index 6a7586c..d562863 100644 --- a/yavta.c +++ b/yavta.c @@ -2256,7 +2256,8 @@ static int video_do_capture(struct device *dev, unsigned int nframes, i, ts.tv_sec, ts.tv_nsec/1000, fps, bps); done: - return video_free_buffers(dev); + video_free_buffers(dev); + return ret; } #define V4L_BUFFERS_DEFAULT 8 -- cgit v1.2.3