From: Andrew Morton Date: Thu, 29 Nov 2012 03:18:44 +0000 (+1100) Subject: rtc-avoid-calling-platform_device_put-twice-in-test_init-fix X-Git-Tag: next-20121205~1^2~122 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a0a40124903a1b37eb431d6be054a02a7a00063a;p=karo-tx-linux.git rtc-avoid-calling-platform_device_put-twice-in-test_init-fix improve label naming Cc: Wei Yongjun Cc: Alessandro Zummo Signed-off-by: Andrew Morton --- diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index 209a12723038..974b9ae252ab 100644 --- a/drivers/rtc/rtc-test.c +++ b/drivers/rtc/rtc-test.c @@ -152,24 +152,24 @@ static int __init test_init(void) if ((test1 = platform_device_alloc("rtc-test", 1)) == NULL) { err = -ENOMEM; - goto exit_free_test0; + goto exit_put_test0; } if ((err = platform_device_add(test0))) - goto exit_free_test1; + goto exit_put_test1; if ((err = platform_device_add(test1))) - goto exit_device_unregister; + goto exit_del_test0; return 0; -exit_device_unregister: +exit_del_test0: platform_device_del(test0); -exit_free_test1: +exit_put_test1: platform_device_put(test1); -exit_free_test0: +exit_put_test0: platform_device_put(test0); exit_driver_unregister: