aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna3@gmail.com>2019-03-06 21:17:47 (GMT)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-13 13:54:19 (GMT)
commitc11082a346f8879acd92cb6e5b41b4eb49828113 (patch)
treefef1537497196f8c50acc5c4e9663f75a3ea5aab
parentc2b36007acf780836b9a122ade1db320fe46e11b (diff)
v4l2-ctl: in streaming_set_m2m, close file pointers upon error
In streaming_set_m2m, make sure to close all file pointers and file descriptors before returning. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-streaming.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 271cfac..d818674 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -2145,18 +2145,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();

Privacy Policy