summaryrefslogtreecommitdiffstats
path: root/drivers/atmodem/call-forwarding.c
diff options
context:
space:
mode:
authorMingli Wu <mingli@southpole.se>2012-12-04 16:33:47 +0100
committerDenis Kenzior <denkenz@gmail.com>2012-12-04 23:48:14 -0600
commit911eeb6565bf3cdf04322f3a2c040431b19808bb (patch)
tree6f231416d95dcbee971af2125f69594ecae19c8f /drivers/atmodem/call-forwarding.c
parent25e7ecd3c783d03e833938c617e4507bf6e9394a (diff)
downloadofono-911eeb6565bf3cdf04322f3a2c040431b19808bb.tar.bz2
atmodem: remove pending idle callbacks at removal
If device probe and removal happen in short succession, it's possible that the idle handler registered in the probe function doesn't run before the device is removed. In this case, the idle handler needs to be unregistered so that it does not run and try to access the data that's destroyed during the removal.
Diffstat (limited to 'drivers/atmodem/call-forwarding.c')
-rw-r--r--drivers/atmodem/call-forwarding.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/atmodem/call-forwarding.c b/drivers/atmodem/call-forwarding.c
index cbe4b24e..e2020d36 100644
--- a/drivers/atmodem/call-forwarding.c
+++ b/drivers/atmodem/call-forwarding.c
@@ -259,6 +259,7 @@ static void at_ccfc_remove(struct ofono_call_forwarding *cf)
{
GAtChat *chat = ofono_call_forwarding_get_data(cf);
+ g_idle_remove_by_data(cf);
g_at_chat_unref(chat);
ofono_call_forwarding_set_data(cf, NULL);
}