diff mbox series

[BlueZ,2/3] gatt-db: Check if permissions are set when adding CCC

Message ID 20220921214656.2241730-2-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,1/3] gatt: Fix not setting permissions for CCC | expand

Commit Message

Luiz Augusto von Dentz Sept. 21, 2022, 9:46 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

CCC shall always have some permission set.
---
 src/shared/gatt-db.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c
index d3b5cec1da86..32cbf6cdc38b 100644
--- a/src/shared/gatt-db.c
+++ b/src/shared/gatt-db.c
@@ -1066,7 +1066,7 @@  gatt_db_service_add_ccc(struct gatt_db_attribute *attrib, uint32_t permissions)
 	struct gatt_db_attribute *value;
 	uint16_t handle = 0;
 
-	if (!attrib)
+	if (!attrib || !permissions)
 		return NULL;
 
 	db = attrib->service->db;