[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55bc07edcca27b5be96642aede3d71fe076af668.camel@mediatek.com>
Date: Tue, 11 Apr 2023 07:22:31 +0000
From: Yunfei Dong (董云飞)
<Yunfei.Dong@...iatek.com>
To: "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"mchehab@...nel.org" <mchehab@...nel.org>,
Irui Wang (王瑞) <Irui.Wang@...iatek.com>,
"hverkuil-cisco@...all.nl" <hverkuil-cisco@...all.nl>
CC: "linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
Maoguang Meng (孟毛广)
<Maoguang.Meng@...iatek.com>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@...iatek.com>
Subject: Re: [PATCH v2, 2/2] media: mediatek: vcodec: make sure pointer isn't
NULL before used
Hi Irui,
On Tue, 2023-04-11 at 13:54 +0800, Irui Wang wrote:
> CERT-C Expression check:
> Dereferencing buf, which is known to be NULL, check buf is not NULL
> before used.
>
Whether 'dereferencing buf' is one kind of CERT-C Expression check?
You can re-write commit message and subject.
CERT-C Expression check (Dereferencing buf):
Making sure the pointer is not NULL before to be used.
Best Regards,
Yunfei Dong
> Signed-off-by: Irui Wang <irui.wang@...iatek.com>
> ---
> drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
> b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
> index d65800a3b89d..db65e77bd373 100644
> --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
> +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
> @@ -943,7 +943,7 @@ static int vb2ops_venc_start_streaming(struct
> vb2_queue *q, unsigned int count)
> * FIXME: This check is not needed as only active
> buffers
> * can be marked as done.
> */
> - if (buf->state == VB2_BUF_STATE_ACTIVE) {
> + if (buf && buf->state == VB2_BUF_STATE_ACTIVE) {
> mtk_v4l2_debug(0, "[%d] id=%d, type=%d, %d ->
> VB2_BUF_STATE_QUEUED",
> ctx->id, i, q->type,
> (int)buf->state);
Powered by blists - more mailing lists