[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:22:04 MSK 2026


On 5/7/26 7:18 PM, Sergey Shtylyov 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. :-)

   Ah, I was looking at the wrong function. Sorry! :-)

[...]

MBR, Sergey



More information about the lvc-project mailing list