diff mbox series

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

Message ID 20220701094602.2365099-1-yangyingliang@huawei.com
State New
Headers show
Series ARM: omap1: call platform_device_put() in error case in omap1_dm_timer_init() | expand

Commit Message

Yang Yingliang July 1, 2022, 9:46 a.m. UTC
If platform_device_add() is not called or failed, it should call
platform_device_put() in error case.

Fixes: 97933d6ced60 ("ARM: OMAP1: dmtimer: conversion to platform devices")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 arch/arm/mach-omap1/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tony Lindgren July 4, 2022, 7:20 a.m. UTC | #1
* Yang Yingliang <yangyingliang@huawei.com> [220701 12:30]:
> If platform_device_add() is not called or failed, it should call
> platform_device_put() in error case.

Thanks applying into omap-for-v5.20/omap1.

Regards,

Tony
diff mbox series

Patch

diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
index f5cd4bbf7566..81a912c1145a 100644
--- a/arch/arm/mach-omap1/timer.c
+++ b/arch/arm/mach-omap1/timer.c
@@ -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;
 }