From edd41d8259f82c4fedc906b5ca5edcad05da5b42 Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Fri, 24 Jun 2022 11:24:18 +0200 Subject: [PATCH] v4l2: close v4l2 device on error The device needs to be closed when the enum_controls function is exited, but is not closed if the VIDIOC_QUERYCTRL fails. Fix it. --- spa/plugins/v4l2/v4l2-utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index 80fa2bd87..d4b39d509 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -1123,6 +1123,7 @@ spa_v4l2_enum_controls(struct impl *this, int seq, } res = -errno; spa_log_error(this->log, "'%s' VIDIOC_QUERYCTRL: %m", this->props.device); + spa_v4l2_close(dev); return res; } if (result.next & next_fl)