[lvc-project] [PATCH] media: v4l2-ctrls-request: add NULL check in, v4l2_ctrl_request_complete()

Fedor Pchelkin pchelkin at ispras.ru
Thu May 7 18:44:39 MSK 2026


Hi,

On Fri, 01. May 23:28, 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
then v4l2_ctrl_request_bind() will return an error which is already
handled.  Looking at what the API implies, this seems reasonable, too.
Anyway, left for your preference.



More information about the lvc-project mailing list