lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sat, 23 Mar 2024 01:45:14 +0000
From: Irui Wang (王瑞) <Irui.Wang@...iatek.com>
To: "matthias.bgg@...il.com" <matthias.bgg@...il.com>, "mchehab@...nel.org"
	<mchehab@...nel.org>, "sebastian.fricke@...labora.com"
	<sebastian.fricke@...labora.com>, "angelogioacchino.delregno@...labora.com"
	<angelogioacchino.delregno@...labora.com>, "nicolas.dufresne@...labora.com"
	<nicolas.dufresne@...labora.com>, "hverkuil-cisco@...all.nl"
	<hverkuil-cisco@...all.nl>, Yunfei Dong (董云飞)
	<Yunfei.Dong@...iatek.com>
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>,
	Maoguang Meng (孟毛广)
	<Maoguang.Meng@...iatek.com>, "linux-mediatek@...ts.infradead.org"
	<linux-mediatek@...ts.infradead.org>,
	Longfei Wang (王龙飞) <Longfei.Wang@...iatek.com>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@...iatek.com>
Subject: Re: [PATCH] media: mediatek: vcodec: Handle invalid decoder vsi

Dear Nicolas,

Thanks for your reviewing.

On Fri, 2024-03-22 at 10:44 -0400, Nicolas Dufresne wrote:
> 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@...iatek.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 ?

Do you mean the returned 'err'?, it's the status value returned by
'send message'. Even if the 'vsi' is NULL, the returned status value
'err' may still be 'NO_ERROR', there is no direct relationship between
them.

If I misunderstood your question, please correct me. Thank you very
much.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ