]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/mediatek: Add missing put_device() call in mtk_ddp_comp_init()
authorYu Kuai <yukuai3@huawei.com>
Sat, 5 Sep 2020 08:30:58 +0000 (16:30 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Wed, 16 Sep 2020 22:58:01 +0000 (06:58 +0800)
if of_find_device_by_node() succeed, mtk_ddp_comp_init() doesn't have
a corresponding put_device(). Thus add put_device() to fix the exception
handling for this function implementation.

Fixes: d0afe37f5209 ("drm/mediatek: support CMDQ interface in ddp component")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c

index 57c88de9a3293447e70965c6628258f7c9f31e05..526648885b97efe57d260da08ac69d883083e8d7 100644 (file)
@@ -496,6 +496,7 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node,
 #if IS_REACHABLE(CONFIG_MTK_CMDQ)
        if (of_address_to_resource(node, 0, &res) != 0) {
                dev_err(dev, "Missing reg in %s node\n", node->full_name);
+               put_device(&larb_pdev->dev);
                return -EINVAL;
        }
        comp->regs_pa = res.start;