public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [v4l-utils PATCH v5 1/6] v4l2-ctl: in streaming_set_m2m, close file pointers upon error
@ 2019-03-06 21:17 Dafna Hirschfeld
  2019-03-06 21:17 ` [v4l-utils PATCH v5 2/6] v4l2-ctl: check that the size read/write fit the buffer size Dafna Hirschfeld
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Dafna Hirschfeld @ 2019-03-06 21:17 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil, helen.koike, Dafna Hirschfeld

In streaming_set_m2m, make sure to close all file pointers
and file descriptors before returning.

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
---
 utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 0eda8449..ee84abbe 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -2141,18 +2141,19 @@ static void streaming_set_m2m(cv4l_fd &fd, cv4l_fd &exp_fd)
 
 	if (options[OptStreamDmaBuf]) {
 		if (exp_q.reqbufs(&exp_fd, reqbufs_count_cap))
-			return;
+			goto done;
 		exp_fd_p = &exp_fd;
 	}
 
 	if (options[OptStreamOutDmaBuf]) {
 		if (exp_q.reqbufs(&exp_fd, reqbufs_count_out))
-			return;
+			goto done;
 		if (out.export_bufs(&exp_fd, exp_fd.g_type()))
-			return;
+			goto done;
 	}
 	stateful_m2m(fd, in, out, file[CAP], file[OUT], exp_fd_p);
 
+done:
 	if (options[OptStreamDmaBuf] || options[OptStreamOutDmaBuf])
 		exp_q.close_exported_fds();
 
-- 
2.17.1


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

end of thread, other threads:[~2019-03-06 21:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-06 21:17 [v4l-utils PATCH v5 1/6] v4l2-ctl: in streaming_set_m2m, close file pointers upon error Dafna Hirschfeld
2019-03-06 21:17 ` [v4l-utils PATCH v5 2/6] v4l2-ctl: check that the size read/write fit the buffer size Dafna Hirschfeld
2019-03-06 21:17 ` [v4l-utils PATCH v5 3/6] v4l2-ctl: set the in/out fmt variables in streaming_set_m2m Dafna Hirschfeld
2019-03-06 21:17 ` [v4l-utils PATCH v5 4/6] v4l-utils: copy fwht-ctrls.h from kernel dir Dafna Hirschfeld
2019-03-06 21:17 ` [v4l-utils PATCH v5 5/6] v4l2-ctl: Add functions and variables to support fwht stateless decoder Dafna Hirschfeld
2019-03-06 21:17 ` [v4l-utils PATCH v5 6/6] v4l2-ctl: Add implementation for the stateless fwht decoder Dafna Hirschfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox