ARM: OMAP1: call platform_device_put() in error case in omap1_dm_timer_init()

If platform_device_add() is not called or failed, it should call
platform_device_put() in error case.

Fixes: 97933d6ced ("ARM: OMAP1: dmtimer: conversion to platform devices")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Message-Id: <20220701094602.2365099-1-yangyingliang@huawei.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
Yang Yingliang 2023-01-19 11:57:54 +02:00 committed by Tony Lindgren
parent 1b929c02af
commit 0414a100d6

View File

@ -158,7 +158,7 @@ static int __init omap1_dm_timer_init(void)
kfree(pdata);
err_free_pdev:
platform_device_unregister(pdev);
platform_device_put(pdev);
return ret;
}