From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: "Philippe Mathieu-Daudé " <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, Thomas Huth <thuth@redhat.com>,
Gustavo Romero <gustavo.romero@linaro.org>,
Pierrick Bouvier <pierrick.bouvier@linaro.org>,
Zheyu Ma <zheyuma97@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH v1 1/1] virtio-snd: add max size bounds check in input cb
Date: Mon, 08 Jul 2024 12:29:43 +0300 [thread overview]
Message-ID: <gatbq.jld0hhud3s8l@linaro.org> (raw)
In-Reply-To: <86e04959-4d48-49fd-b065-a9288a7b064a@linaro.org>
Thanks for the review Philippe,
On Mon, 08 Jul 2024 11:28, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>> + max_size = iov_size(buffer->elem->in_sg,
>> buffer->elem->in_num);
>> for (;;) {
>> + if (buffer->size >= max_size) {
>> + return_rx_buffer(stream, buffer);
>
>return_rx_buffer() could be renamed
>flush_input_stream_to_buffer() for clarity.
>
return_rx_buffer() is vague but I think flush_input_stream_to_buffer()
is more vague 🤔. I tried to use short names as much as possible and
document the purpose in doc comments. Unfortunately the device's state
machine is complex so the code complexity is necessary :/
Manos
next prev parent reply other threads:[~2024-07-08 9:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 7:09 [PATCH v1 1/1] virtio-snd: add max size bounds check in input cb Manos Pitsidianakis
2024-07-08 8:28 ` Philippe Mathieu-Daudé
2024-07-08 9:29 ` Manos Pitsidianakis [this message]
2024-07-09 14:16 ` Matias Ezequiel Vara Larsen
2024-07-09 16:21 ` Manos Pitsidianakis
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=gatbq.jld0hhud3s8l@linaro.org \
--to=manos.pitsidianakis@linaro.org \
--cc=gustavo.romero@linaro.org \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=thuth@redhat.com \
--cc=zheyuma97@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).