[PATCH BlueZ v3 05/27] network: Fail if multiple profile instances

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx>

Considerable parts codebase are assuming that there is one single
instance of each UUID and therefore return an error during probe instead
of silently ignoring duplicated entries.
---
 profiles/network/connection.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/profiles/network/connection.c b/profiles/network/connection.c
index 3a913cf..3ccd211 100644
--- a/profiles/network/connection.c
+++ b/profiles/network/connection.c
@@ -698,8 +698,11 @@ int connection_register(struct btd_device *device, uint16_t id)
 	}
 
 	nc = find_connection(peer->connections, id);
-	if (nc)
-		return 0;
+	if (nc) {
+		error("Device %s has multiple connection instances of %d",
+						device_get_path(device), id);
+		return -1;
+	}
 
 	nc = g_new0(struct network_conn, 1);
 	nc->id = id;
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux