Message ID | YxDGFMwyeNXFPaig@kili (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | media: platform: mtk-mdp3: fix error code in mdp_vpu_dev_init() | expand |
Il 01/09/22 16:47, Dan Carpenter ha scritto: > Return a negative error code if mdp_vpu_shared_mem_alloc() fails. > > Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
On 01/09/2022 16:47, Dan Carpenter wrote: > Return a negative error code if mdp_vpu_shared_mem_alloc() fails. > > Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> > --- > drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c > index 9f5844385c8f..a72bed927bb6 100644 > --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c > +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c > @@ -173,7 +173,8 @@ int mdp_vpu_dev_init(struct mdp_vpu_dev *vpu, struct mtk_scp *scp, > /* vpu work_size was set in mdp_vpu_ipi_handle_init_ack */ > > mem_size = vpu_alloc_size; > - if (mdp_vpu_shared_mem_alloc(vpu)) { > + err = mdp_vpu_shared_mem_alloc(vpu); > + if (err) { > dev_err(&mdp->pdev->dev, "VPU memory alloc fail!"); > goto err_mem_alloc; > }
diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c index 9f5844385c8f..a72bed927bb6 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c @@ -173,7 +173,8 @@ int mdp_vpu_dev_init(struct mdp_vpu_dev *vpu, struct mtk_scp *scp, /* vpu work_size was set in mdp_vpu_ipi_handle_init_ack */ mem_size = vpu_alloc_size; - if (mdp_vpu_shared_mem_alloc(vpu)) { + err = mdp_vpu_shared_mem_alloc(vpu); + if (err) { dev_err(&mdp->pdev->dev, "VPU memory alloc fail!"); goto err_mem_alloc; }
Return a negative error code if mdp_vpu_shared_mem_alloc() fails. Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)