Hi Martin,

On Tue, Mar 23, 2010 at 11:43:50AM +0800, martin...@intel.com wrote:
> From: Martin Xu <martin...@intel.com>
> 
> oFono plugin can use network->device to decide whether
> the modem is removed during active PrimaryContext. And fix
> the segmenation issue when removing 3G modem.
Patch applied, many thanks.

Cheers,
Samuel.


> ---
>  plugins/ofono.c |    4 +++-
>  src/device.c    |    2 ++
>  src/network.c   |    3 ++-
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/plugins/ofono.c b/plugins/ofono.c
> index c5521ef..2ad01f2 100644
> --- a/plugins/ofono.c
> +++ b/plugins/ofono.c
> @@ -398,8 +398,10 @@ static gboolean pending_network_is_available(
>  
>       /* Modem may be removed during waiting for active reply */
>       device  = connman_network_get_device(pending_network);
> -     if (device == NULL)
> +     if (device == NULL) {
> +             DBG("Modem is removed");
>               return FALSE;
> +     }
>  
>       identifier = connman_network_get_identifier(pending_network);
>  
> diff --git a/src/device.c b/src/device.c
> index f9dbe86..6aeed01 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -656,6 +656,8 @@ static void unregister_network(gpointer data)
>       connman_element_unregister((struct connman_element *) network);
>  
>       connman_network_unref(network);
> +
> +     __connman_network_set_device(network, NULL);
>  }
>  
>  static void device_destruct(struct connman_element *element)
> diff --git a/src/network.c b/src/network.c
> index 3fca7bb..8fb0ea0 100644
> --- a/src/network.c
> +++ b/src/network.c
> @@ -237,7 +237,8 @@ static void unregister_interface(struct connman_element 
> *element)
>  
>       network->registered = FALSE;
>  
> -     emit_networks_signal(network->device);
> +     if (network->device != NULL)
> +             emit_networks_signal(network->device);
>  
>       g_dbus_unregister_interface(connection, element->path,
>                                               CONNMAN_NETWORK_INTERFACE);
> -- 
> 1.6.1.3
> 
> _______________________________________________
> connman mailing list
> connman@connman.net
> http://lists.connman.net/listinfo/connman

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to