Diff between 18bdb1234d712dc466e7d71e8f6dc75ea1ef0c86 and 394a1f9aa7e191b80a9d6a60104734bd70f6c191

Changed Files

File Additions Deletions Status
profiles/network/connection.c +4 -1 modified

Full Patch

diff --git a/profiles/network/connection.c b/profiles/network/connection.c
index 84f3dd6..bac3b69 100644
--- a/profiles/network/connection.c
+++ b/profiles/network/connection.c
@@ -426,7 +426,10 @@ static DBusMessage *local_connect(DBusConnection *conn,
 	id = bnep_service_id(svc);
 
 	nc = find_connection(peer->connections, id);
-	if (nc && nc->connect)
+	if (nc == NULL)
+		return btd_error_invalid_args(msg);
+
+	if (nc->connect != NULL)
 		return btd_error_busy(msg);
 
 	err = connection_connect(nc->service);