mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Irui Wang <irui.wang@mediatek.com>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Yunfei Dong <yunfei.dong@mediatek.com>,
	angelogioacchino.delregno@collabora.com,
	 sebastian.fricke@collabora.com
Cc: Longfei Wang <longfei.wang@mediatek.com>,
	Maoguang Meng <maoguang.meng@mediatek.com>,
	 Project_Global_Chrome_Upstream_Group@mediatek.com,
	linux-media@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] media: mediatek: vcodec: Handle invalid decoder vsi
Date: Fri, 22 Mar 2024 10:44:31 -0400	[thread overview]
Message-ID: <6420a5c39e0a6f85d4fd5a85643d601bd1e2fb05.camel@collabora.com> (raw)
In-Reply-To: <20240320061336.2615-1-irui.wang@mediatek.com>

Hi,

Le mercredi 20 mars 2024 à 14:13 +0800, Irui Wang a écrit :
> Handle invalid decoder vsi in vpu_dec_init to ensure the decoder vsi is
> valid for future use.
> 
> Signed-off-by: Irui Wang <irui.wang@mediatek.com>
> ---
>  .../media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c    | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
> index 82e57ae983d5..17770993fe5a 100644
> --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
> +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
> @@ -231,6 +231,12 @@ int vpu_dec_init(struct vdec_vpu_inst *vpu)
>  	mtk_vdec_debug(vpu->ctx, "vdec_inst=%p", vpu);
>  
>  	err = vcodec_vpu_send_msg(vpu, (void *)&msg, sizeof(msg));
> +
> +	if (IS_ERR_OR_NULL(vpu->vsi)) {
> +		mtk_vdec_err(vpu->ctx, "invalid vdec vsi, status=%d", err);
> +		return -EINVAL;
> +	}
> +

Make sense, though on the cosmetic side, were is the err value from if the vsi
pointer is NULL ?

Nicolas

>  	mtk_vdec_debug(vpu->ctx, "- ret=%d", err);
>  	return err;
>  }


  parent reply	other threads:[~2024-03-22 14:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20  6:13 Irui Wang
2024-03-20  9:13 ` AngeloGioacchino Del Regno
2024-03-21  1:55   ` Irui Wang (王瑞)
2024-03-22 14:44 ` Nicolas Dufresne [this message]
2024-03-23  1:45   ` Irui Wang (王瑞)

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=6420a5c39e0a6f85d4fd5a85643d601bd1e2fb05.camel@collabora.com \
    --to=nicolas.dufresne@collabora.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=irui.wang@mediatek.com \
    --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=longfei.wang@mediatek.com \
    --cc=maoguang.meng@mediatek.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=sebastian.fricke@collabora.com \
    --cc=yunfei.dong@mediatek.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®