summaryrefslogtreecommitdiff
path: root/drivers/soc/mediatek/mtk-mmsys.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2020-05-06 17:13:17 +0300
committerMatthias Brugger <matthias.bgg@gmail.com>2020-05-15 17:52:08 +0300
commitff34e17cf9bce8b6d01c6a1e387720dc3393f45b (patch)
tree6d14cffce1608bdef4b3f4f04f4dd214f5ad9cc6 /drivers/soc/mediatek/mtk-mmsys.c
parent1a6e55ca8f3684d7e1fe646396303233bf1c1ed7 (diff)
downloadlinux-ff34e17cf9bce8b6d01c6a1e387720dc3393f45b.tar.xz
soc: mediatek: Missing platform_device_unregister() on error in mtk_mmsys_probe()
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>
Diffstat (limited to 'drivers/soc/mediatek/mtk-mmsys.c')
-rw-r--r--drivers/soc/mediatek/mtk-mmsys.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
index bb5ccd5b0386..b0bb08a66b01 100644
--- a/drivers/soc/mediatek/mtk-mmsys.c
+++ b/drivers/soc/mediatek/mtk-mmsys.c
@@ -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;
}