From 940efe7e52483362ab545f0ee619d2c691ba892b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 18 Mar 2013 15:14:13 +0800 Subject: [PATCH] rtc: HYM8563: fix probe error handling by destroy wake lock fix this bug: Unable to handle kernel paging request at virtual address 00020008 pgd = d3e60000 [00020008] *pgd=00000000 Internal error: Oops: 5 [#1] PREEMPT SMP CPU: 1 Tainted: G C (3.0.36+ #6) PC is at print_lock_stat+0x1c/0x1b8 LR is at wakelock_stats_show+0x3c/0xa4 or this bug: WARNING: at lib/list_debug.c:26 __list_add+0x60/0x90() list_add corruption. next->prev should be prev (c0ae4468), but was 05900000. (next=d89bb060). [] (unwind_backtrace+0x0/0xfc) from [] (warn_slowpath_common+0x4c/0x64) [] (warn_slowpath_common+0x4c/0x64) from [] (warn_slowpath_fmt+0x30/0x40) [] (warn_slowpath_fmt+0x30/0x40) from [] (__list_add+0x60/0x90) [] (__list_add+0x60/0x90) from [] (wake_lock_init+0x8c/0xe4) [] (wake_lock_init+0x8c/0xe4) from [] (power_supply_register+0xd8/0x100) [] (power_supply_register+0xd8/0x100) from [] (test_power_init+0x18/0x7c) [] (test_power_init+0x18/0x7c) from [] (do_one_initcall+0x34/0x17c) [] (do_one_initcall+0x34/0x17c) from [] (kernel_init+0x98/0x144) [] (kernel_init+0x98/0x144) from [] (kernel_thread_exit+0x0/0x8) --- drivers/rtc/rtc-HYM8563.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-HYM8563.c b/drivers/rtc/rtc-HYM8563.c index 01399e8794dd..706505551dcd 100755 --- a/drivers/rtc/rtc-HYM8563.c +++ b/drivers/rtc/rtc-HYM8563.c @@ -486,8 +486,10 @@ static int __devinit hym8563_probe(struct i2c_client *client, const struct i2c_d exit: if (rtc) rtc_device_unregister(rtc); - if (hym8563) + if (hym8563) { + wake_lock_destroy(&hym8563->wake_lock); kfree(hym8563); + } return rc; } -- 2.34.1