From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Dong Chuanjian <chuanjian@nfschina.com>,
mchehab@kernel.org, hverkuil-cisco@xs4all.nl,
sebastian.fricke@collabora.com, ezequiel@vanguardiasur.com.ar
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/media/v4l2-core/v4l2-h264 : add detection of null pointers
Date: Mon, 09 Jan 2023 16:27:29 -0500 [thread overview]
Message-ID: <8b408632218fd0f06ec862a51822cf08e0f50a57.camel@collabora.com> (raw)
In-Reply-To: <20221227023625.7261-1-chuanjian@nfschina.com>
Le mardi 27 décembre 2022 à 10:36 +0800, Dong Chuanjian a écrit :
> When the pointer variable is judged to be null, null is returned
> directly.
>
> Signed-off-by: Dong Chuanjian <chuanjian@nfschina.com>
Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Please add the missing Fixes tag.
Fixes: d3f756ad629b39 ("media: v4l2: Trace calculated p/b0/b1 initial reflist")
If someone have time, the pr_debug should be ported to v4l2_debug according to
some other reviews.
> ---
> v2: Directly return when pointer allocation fails.
> v3: problems in synchronous repair format_ref_list_p
>
> diff --git a/drivers/media/v4l2-core/v4l2-h264.c b/drivers/media/v4l2-core/v4l2-h264.c
> index 72bd64f65198..f6684c1d7319 100644
> --- a/drivers/media/v4l2-core/v4l2-h264.c
> +++ b/drivers/media/v4l2-core/v4l2-h264.c
> @@ -305,6 +305,8 @@ static const char *format_ref_list_p(const struct v4l2_h264_reflist_builder *bui
> int n = 0, i;
>
> *out_str = kmalloc(tmp_str_size, GFP_KERNEL);
> + if (*out_str == NULL)
> + return NULL;
>
> n += snprintf(*out_str + n, tmp_str_size - n, "|");
>
> @@ -343,6 +345,8 @@ static const char *format_ref_list_b(const struct v4l2_h264_reflist_builder *bui
> int n = 0, i;
>
> *out_str = kmalloc(tmp_str_size, GFP_KERNEL);
> + if (*out_str == NULL)
> + return NULL;
>
> n += snprintf(*out_str + n, tmp_str_size - n, "|");
>
prev parent reply other threads:[~2023-01-09 21:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-27 2:36 Dong Chuanjian
2023-01-09 21:27 ` Nicolas Dufresne [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=8b408632218fd0f06ec862a51822cf08e0f50a57.camel@collabora.com \
--to=nicolas.dufresne@collabora.com \
--cc=chuanjian@nfschina.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sebastian.fricke@collabora.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
all inboxes | Powered by JetHome®