Linux Media Controller development
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@auroraos.dev>
To: Fedor Pchelkin <pchelkin@ispras.ru>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	<linux-media@vger.kernel.org>, Hans Verkuil <hverkuil@kernel.org>,
	<lvc-project@linuxtesting.org>
Subject: Re: [PATCH] media: v4l2-ctrls-request: add NULL check in, v4l2_ctrl_request_complete()
Date: Thu, 7 May 2026 19:22:04 +0300	[thread overview]
Message-ID: <460114e8-836a-41a2-b37e-994b7932dffe@auroraos.dev> (raw)
In-Reply-To: <a29d5a17-3e3e-451a-b366-e0213d3ed9ad@auroraos.dev>

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

      reply	other threads:[~2026-05-07 16:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 20:28 [PATCH] media: v4l2-ctrls-request: add NULL check in, v4l2_ctrl_request_complete() Sergey Shtylyov
2026-05-02  8:52 ` Sergey Shtylyov
2026-05-02 16:52   ` Sergey Shtylyov
2026-05-07 15:44 ` Fedor Pchelkin
2026-05-07 16:18   ` Sergey Shtylyov
2026-05-07 16:22     ` Sergey Shtylyov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=460114e8-836a-41a2-b37e-994b7932dffe@auroraos.dev \
    --to=s.shtylyov@auroraos.dev \
    --cc=hverkuil@kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=mchehab@kernel.org \
    --cc=pchelkin@ispras.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox