This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l-helpers: return a positive errno on error
Author:  Hans Verkuil <[email protected]>
Date:    Thu Aug 27 09:32:35 2026 +0200

v4l_named_ioctl() and all the helpers built on top of it report errors
as a positive errno value. Two error paths deviated from this and
returned a negative errno instead:

- v4l_queue_alloc_bufs_info() returned -ENOMEM when calloc() failed.
- v4l_query_ext_ctrl() returned -EINVAL when asked to enumerate compound
  controls without VIDIOC_QUERY_EXT_CTRL support.

Neither is currently reachable by an in-tree caller that inspects the
result, but leaving them inverted is a trap for new callers: a caller
doing 'if (ret == ENOMEM)' or feeding the value to strerror() would
misbehave.

Make both consistent with the rest of the file.

Signed-off-by: Hans Verkuil <[email protected]>
Assisted-by: Claude-Code:claude-opus-5

 utils/common/v4l-helpers.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=1d8702999ae32f699ac12fb231ace36b3d08835d
diff --git a/utils/common/v4l-helpers.h b/utils/common/v4l-helpers.h
index 5ff634f82cfc..eace210fb1a6 100644
--- a/utils/common/v4l-helpers.h
+++ b/utils/common/v4l-helpers.h
@@ -1486,7 +1486,7 @@ static inline int v4l_queue_alloc_bufs_info(struct 
v4l_queue *q)
                return 0;
        bi = (struct v4l_queue_buf_info *)calloc(q->max_num_buffers, 
sizeof(*bi));
        if (!bi)
-               return -ENOMEM;
+               return ENOMEM;
        for (i = 0; i < VIDEO_MAX_FRAME; i++)
                bi[i] = q->bufs_info[i];
        for (i = VIDEO_MAX_FRAME; i < q->max_num_buffers; i++)
@@ -1889,7 +1889,7 @@ static inline int v4l_query_ext_ctrl(v4l_fd *f, struct 
v4l2_query_ext_ctrl *qec,
 
        if (next_compound && !f->have_query_ext_ctrl) {
                if (!next_ctrl)
-                       return -EINVAL;
+                       return EINVAL;
                next_compound = false;
        }
        if (next_compound)
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to