Hi Mikel,

On 04/18/2012 10:19 AM, Mikel Astiz wrote:
> Calling ofono_remove_modem() while iterating the hash table is not safe
> given that it can modify the table in hfp_remove().
> 
> A simple way to reproduce the problem is to pair some Bluetooth phones
> and remove the Bluetooth adapter, triggering a GLib-CRITICAL assertion.
> 
> This approach proposes a two-step removal: first, the hash table is
> iterated and all modems to be removed are marked as pending (thus
> removed from the hash table and put in a temporary list), and afterwards
> all pending modems are actually removed.
> ---
>  plugins/hfp_hf.c |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletions(-)
> 

The patch looks absolutely fine, however can you check whether removing
g_hashtable_remove from hfp_remove would do the trick as well?  We don't
seem to be doing this in the sap driver, and I no longer recall whether
this was done in hfp_hf to keep valgrind happy or is simply a mistake.

Regards,
-Denis
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to