Message ID | 20220902085820.3777360-4-sunke32@huawei.com |
---|---|
State | New |
Headers | show |
Series | three fixes for mtk-mdp3 | expand |
在 2022/9/2 17:10, AngeloGioacchino Del Regno 写道: > Il 02/09/22 10:58, Sun Ke ha scritto: >> If mdp_vpu_shared_mem_alloc failed, mdp_vpu_dev_init should return >> -ENOMEM. >> >> Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 >> driver") >> Signed-off-by: Sun Ke <sunke32@huawei.com> > > Hello Sun, > thanks for the patch! However, someone else already sent the same fix > and it's > in a better shape. Please look at [1]. > > Thanks, > Angelo > > [1]: > https://patchwork.kernel.org/project/linux-mediatek/patch/YxDGFMwyeNXFPaig@kili/ Oh. I am late. Thanks, Sun Ke > > >> --- >> drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c >> b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c >> index 9f5844385c8f..078040b7f65e 100644 >> --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c >> +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c >> @@ -175,6 +175,7 @@ int mdp_vpu_dev_init(struct mdp_vpu_dev *vpu, >> struct mtk_scp *scp, >> mem_size = vpu_alloc_size; >> if (mdp_vpu_shared_mem_alloc(vpu)) { >> dev_err(&mdp->pdev->dev, "VPU memory alloc fail!"); >> + err = -ENOMEM; >> 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..078040b7f65e 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c @@ -175,6 +175,7 @@ int mdp_vpu_dev_init(struct mdp_vpu_dev *vpu, struct mtk_scp *scp, mem_size = vpu_alloc_size; if (mdp_vpu_shared_mem_alloc(vpu)) { dev_err(&mdp->pdev->dev, "VPU memory alloc fail!"); + err = -ENOMEM; goto err_mem_alloc; }
If mdp_vpu_shared_mem_alloc failed, mdp_vpu_dev_init should return -ENOMEM. Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") Signed-off-by: Sun Ke <sunke32@huawei.com> --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c | 1 + 1 file changed, 1 insertion(+)