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