Skip to content

Commit ff34e17

Browse files
Wei Yongjunmbgg
authored andcommitted
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: 667c769 ("soc / drm: mediatek: Fix mediatek-drm device probing") Signed-off-by: Wei Yongjun <[email protected]> Reviewed-by: Enric Balletbo i Serra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Matthias Brugger <[email protected]>
1 parent 1a6e55c commit ff34e17

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/soc/mediatek/mtk-mmsys.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,10 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
311311

312312
drm = platform_device_register_data(&pdev->dev, "mediatek-drm",
313313
PLATFORM_DEVID_AUTO, NULL, 0);
314-
if (IS_ERR(drm))
314+
if (IS_ERR(drm)) {
315+
platform_device_unregister(clks);
315316
return PTR_ERR(drm);
317+
}
316318

317319
return 0;
318320
}

0 commit comments

Comments
 (0)