provider: Remove pointless jump to error label
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 12 Jul 2011 09:39:04 +0000 (11:39 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 12 Jul 2011 09:39:04 +0000 (11:39 +0200)
This fixes a compiler warning for an uninitialized variable. And this
warning is a real error.

  CC     src/provider.o
src/provider.c: In function ‘__connman_provider_create_and_connect’:
src/provider.c:476: warning: ‘provider’ may be used uninitialized in this function

src/provider.c

index 1519cb5..68183dc 100644 (file)
@@ -510,17 +510,13 @@ int __connman_provider_create_and_connect(DBusMessage *msg)
                dbus_message_iter_next(&array);
        }
 
-       if (host == NULL || domain == NULL) {
-               err = -EINVAL;
-               goto failed;
-       }
+       if (host == NULL || domain == NULL)
+               return -EINVAL;
 
        DBG("Type %s name %s", type, name);
 
-       if (type == NULL || name == NULL) {
-               err = -EOPNOTSUPP;
-               goto failed;
-       }
+       if (type == NULL || name == NULL)
+               return -EOPNOTSUPP;
 
        ident = g_strdup_printf("%s_%s", host, domain);
        provider_dbus_ident(ident);