Cleanup: No sense in creating the hash if failed
authorDenis Kenzior <denkenz@gmail.com>
Fri, 12 Feb 2010 22:05:09 +0000 (16:05 -0600)
committerDenis Kenzior <denkenz@gmail.com>
Fri, 12 Feb 2010 22:05:09 +0000 (16:05 -0600)
plugins/hfp.c

index 219f268..29a11f7 100644 (file)
@@ -999,15 +999,14 @@ static int hfp_init()
                                                "PropertyChanged",
                                                uuid_emitted, NULL, NULL);
 
-
-       uuid_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
-                       g_free, g_free);
-
        if (adapter_watch == 0 || uuid_watch == 0) {
                err = -EIO;
                goto remove;
        }
 
+       uuid_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
+                                               g_free, g_free);
+
        err = ofono_modem_driver_register(&hfp_driver);
        if (err < 0)
                goto remove;