From 911eeb6565bf3cdf04322f3a2c040431b19808bb Mon Sep 17 00:00:00 2001 From: Mingli Wu Date: Tue, 4 Dec 2012 16:33:47 +0100 Subject: 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. --- drivers/atmodem/sim-auth.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/atmodem/sim-auth.c') diff --git a/drivers/atmodem/sim-auth.c b/drivers/atmodem/sim-auth.c index 9ce810f6..271ceed2 100644 --- a/drivers/atmodem/sim-auth.c +++ b/drivers/atmodem/sim-auth.c @@ -139,6 +139,7 @@ static void at_sim_auth_remove(struct ofono_sim_auth *sa) { struct sim_auth_data *sad = ofono_sim_auth_get_data(sa); + g_idle_remove_by_data(sa); ofono_sim_auth_set_data(sa, NULL); g_at_chat_unref(sad->chat); -- cgit v1.2.3