To avoid the race condition that modem is registered before we retrieve
the data device property.
---
 plugins/udev.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/plugins/udev.c b/plugins/udev.c
index 6850bf9..83468ce 100644
--- a/plugins/udev.c
+++ b/plugins/udev.c
@@ -98,7 +98,7 @@ static void add_mbm(struct ofono_modem *modem,
                                        struct udev_device *udev_device)
 {
        const char *desc, *devnode;
-       const char *device, *network;
+       const char *device, *data, *network;
        int registered;
 
        desc = udev_device_get_sysattr_value(udev_device, "device/interface");
@@ -144,9 +144,10 @@ static void add_mbm(struct ofono_modem *modem,
        }
 
        device  = ofono_modem_get_string(modem, MODEM_DEVICE);
+       data = ofono_modem_get_string(modem, DATA_DEVICE);
        network = ofono_modem_get_string(modem, NETWORK_INTERFACE);
 
-       if (device != NULL && network != NULL) {
+       if (device != NULL && data != NULL && network != NULL) {
                ofono_modem_set_integer(modem, "Registered", 1);
                ofono_modem_register(modem);
        }
-- 
1.6.3.3

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to