mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yunfei Dong (董云飞)" <Yunfei.Dong@mediatek.com>
To: "matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"Irui Wang (王瑞)" <Irui.Wang@mediatek.com>,
	"hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Maoguang Meng (孟毛广)" <Maoguang.Meng@mediatek.com>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH v2, 2/2] media: mediatek: vcodec: make sure pointer isn't NULL before used
Date: Tue, 11 Apr 2023 07:22:31 +0000	[thread overview]
Message-ID: <55bc07edcca27b5be96642aede3d71fe076af668.camel@mediatek.com> (raw)
In-Reply-To: <20230411055413.539-3-irui.wang@mediatek.com>

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@mediatek.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);

  reply	other threads:[~2023-04-11  7:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11  5:54 [PATCH v2, 0/2] fix coverity issues in encoder driver Irui Wang
2023-04-11  5:54 ` [PATCH v2, 1/2] media: mediatek: vcodec: make sure array index is in valid range Irui Wang
2023-04-11  8:22   ` Alexandre Mergnat
2023-04-11  5:54 ` [PATCH v2, 2/2] media: mediatek: vcodec: make sure pointer isn't NULL before used Irui Wang
2023-04-11  7:22   ` Yunfei Dong (董云飞) [this message]
2023-04-11  7:38     ` Irui Wang (王瑞)
2023-04-11  6:25 ` [PATCH v2, 0/2] fix coverity issues in encoder driver Yunfei Dong (董云飞)

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=55bc07edcca27b5be96642aede3d71fe076af668.camel@mediatek.com \
    --to=yunfei.dong@mediatek.com \
    --cc=Irui.Wang@mediatek.com \
    --cc=Maoguang.Meng@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    /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®