soc: mediatek: Missing platform_device_unregister() on error in mtk_mmsys_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 6 May 2020 14:13:17 +0000 (14:13 +0000)
committerMatthias Brugger <matthias.bgg@gmail.com>
Fri, 15 May 2020 14:52:08 +0000 (16:52 +0200)
Add the missing platform_device_unregister() before return
from mtk_mmsys_probe() in the error handling case.

Fixes: 667c769246b0 ("soc / drm: mediatek: Fix mediatek-drm device probing")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20200506141317.119537-1-weiyongjun1@huawei.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
drivers/soc/mediatek/mtk-mmsys.c

index bb5ccd5..b0bb08a 100644 (file)
@@ -311,8 +311,10 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
 
        drm = platform_device_register_data(&pdev->dev, "mediatek-drm",
                                            PLATFORM_DEVID_AUTO, NULL, 0);
-       if (IS_ERR(drm))
+       if (IS_ERR(drm)) {
+               platform_device_unregister(clks);
                return PTR_ERR(drm);
+       }
 
        return 0;
 }