From a71cd05401832163f0e1b46e9bad2f541142af6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Tue, 3 Dec 2024 20:43:59 +0100 Subject: [PATCH] spa: v4l2: query_ext_ctrl_ioctl(): only check `errno` on failure `errno` is not guaranteed to be cleared, so only check it if the previous call actually failed. --- spa/plugins/v4l2/v4l2-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index 31a71c5d6..be38ab32d 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -1083,7 +1083,7 @@ static int query_ext_ctrl_ioctl(struct port *port, struct v4l2_query_ext_ctrl *q if (port->have_query_ext_ctrl) { res = xioctl(dev->fd, VIDIOC_QUERY_EXT_CTRL, qctrl); - if (errno != ENOTTY) + if (res == 0 || errno != ENOTTY) return res; port->have_query_ext_ctrl = false; }