Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sun Ke <sunke32@huawei.com>
To: <mchehab@kernel.org>, <matthias.bgg@gmail.com>,
	<hverkuil-cisco@xs4all.nl>, <ping-hsun.wu@mediatek.com>,
	<daoyuan.huang@mediatek.com>, <moudy.ho@mediatek.com>
Cc: <linux-media@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<kernel-janitors@vger.kernel.org>, <sunke32@huawei.com>
Subject: [PATCH 3/3] media: platform: mtk-mdp3: fix error return code in mdp_vpu_dev_init()
Date: Fri, 2 Sep 2022 16:58:20 +0800	[thread overview]
Message-ID: <20220902085820.3777360-4-sunke32@huawei.com> (raw)
In-Reply-To: <20220902085820.3777360-1-sunke32@huawei.com>

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(+)

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;
 	}
 
-- 
2.31.1



  parent reply	other threads:[~2022-09-02  8:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02  8:58 [PATCH 0/3] three fixes for mtk-mdp3 Sun Ke
2022-09-02  8:58 ` [PATCH 1/3] media: platform: mtk-mdp3: use devm_kfree to free memory allocated with devm_kmalloc() Sun Ke
2022-09-02  9:08   ` AngeloGioacchino Del Regno
2022-09-02  8:58 ` [PATCH 2/3] media: platform: mtk-mdp3: fix PM reference leak in mdp_comp_clock_on() Sun Ke
2022-09-23  6:25   ` Sun Ke
2022-09-23 13:04     ` Hans Verkuil
2022-09-02  8:58 ` Sun Ke [this message]
2022-09-02  9:10   ` [PATCH 3/3] media: platform: mtk-mdp3: fix error return code in mdp_vpu_dev_init() AngeloGioacchino Del Regno
2022-09-02 10:15     ` Sun Ke

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=20220902085820.3777360-4-sunke32@huawei.com \
    --to=sunke32@huawei.com \
    --cc=daoyuan.huang@mediatek.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=moudy.ho@mediatek.com \
    --cc=ping-hsun.wu@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