]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: platform: add missing put_device() call in mtk_jpeg_clk_init()
authorYu Kuai <yukuai3@huawei.com>
Fri, 9 Oct 2020 12:37:58 +0000 (14:37 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 16 Nov 2020 09:31:09 +0000 (10:31 +0100)
if of_find_device_by_node() succeeds, mtk_jpeg_clk_init() doesn't have
a corresponding put_device(). Thus add put_device() to fix the exception
handling for this function implementation.

Fixes: 648372a87cee ("media: platform: Change the call functions of getting/enable/disable the jpeg's clock")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c

index 227245ccaedc7995c722e8052791e2064ddca03e..106543391c460af4e6c8fe9b5101e9c5cd5a9338 100644 (file)
@@ -1306,6 +1306,7 @@ static int mtk_jpeg_clk_init(struct mtk_jpeg_dev *jpeg)
                                jpeg->variant->clks);
        if (ret) {
                dev_err(&pdev->dev, "failed to get jpeg clock:%d\n", ret);
+               put_device(&pdev->dev);
                return ret;
        }