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.
This commit is contained in:
Barnabás Pőcze 2024-12-03 20:43:59 +01:00 committed by Wim Taymans
parent 0549996c87
commit de609ff994

View file

@ -1072,7 +1072,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;
}