]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/rtc/rtc-test.c: avoid calling platform_device_put() twice
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 9 Nov 2012 03:04:58 +0000 (14:04 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 12 Nov 2012 04:17:26 +0000 (15:17 +1100)
In case of error, test_init() needs 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 <yongjun_wei@trendmicro.com.cn>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/rtc-test.c

index 7e96254bd365eae1f73b5fc296f7e705b58e05ee..209a127230389202454d2e2c8a85cda6cba0e0af 100644 (file)
@@ -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);