[lvc-project] [PATCH] media: v4l2-ctrls-request: add NULL check in, v4l2_ctrl_request_complete()
Sergey Shtylyov
s.shtylyov at auroraos.dev
Thu May 7 19:18:20 MSK 2026
On 5/7/26 6:44 PM, Fedor Pchelkin wrote:
[...]
>> If CONFIG_MEDIA_CONTROLLER is undefined, media_request_object_find() will
>> always return NULL, so its 2nd call in v4l2_ctrl_request_complete() would
>> fail as well as the 1st one and thus cause hdl to have a wrong value (at
>> the top of memory) and list_for_each_entry() to iterate over the garbage
>> data located there. Add NULL check for the 2nd call and place the error
>> cleanup at the end of v4l2_ctrl_request_complete()...
>
> another way may be to modify the stub version of
> media_request_object_bind() to e.g. return -EINVAL instead of 0. Thus
You mean ERR_PTR(-EINVAL)? Because it returns a pointer now. :-)
> then v4l2_ctrl_request_bind() will return an error which is already
Not sure I follow you there...
> handled. Looking at what the API implies, this seems reasonable, too.
> Anyway, left for your preference.
MBR, Sergey
More information about the lvc-project
mailing list