From patchwork Tue Oct 23 05:08:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: rtc: avoid calling platform_device_put() twice in test_init() Date: Mon, 22 Oct 2012 19:08:41 -0000 From: Wei Yongjun X-Patchwork-Id: 193353 Message-Id: To: a.zummo@towertech.it Cc: yongjun_wei@trendmicro.com.cn, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org From: Wei Yongjun In case of error, the function test_init() need to call platform_device_del() instead of platform_device_unregister(). Otherwise, we may call platform_device_put() twice. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun --- drivers/rtc/rtc-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index 7e96254..209a127 100644 --- a/drivers/rtc/rtc-test.c +++ b/drivers/rtc/rtc-test.c @@ -164,7 +164,7 @@ static int __init test_init(void) return 0; exit_device_unregister: - platform_device_unregister(test0); + platform_device_del(test0); exit_free_test1: platform_device_put(test1);