Diff between 8151afd39538207ea907857e44d79081b9e0097f and ab8a7ebc91fb0a39c2321a98a8cde4bd26a7ff1d

Changed Files

File Additions Deletions Status
audio/gateway.c +3 -3 modified

Full Patch

diff --git a/audio/gateway.c b/audio/gateway.c
index 19f8ce3..c549ef5 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -598,13 +598,13 @@ static DBusMessage *ag_disconnect(DBusConnection *conn, DBusMessage *msg,
 	if (!device->conn)
 		return NULL;
 
+	if (!gw->rfcomm)
+		return btd_error_not_connected(msg);
+
 	reply = dbus_message_new_method_return(msg);
 	if (!reply)
 		return NULL;
 
-	if (!gw->rfcomm)
-		return  btd_error_not_connected(msg);
-
 	gateway_close(device);
 	ba2str(&device->dst, gw_addr);
 	DBG("Disconnected from %s, %s", gw_addr, device->path);