diff --git a/profiles/gatt/manager.c b/profiles/gatt/manager.c
index a1fa756..0702d26 100644
--- a/profiles/gatt/manager.c
+++ b/profiles/gatt/manager.c
#include "gattrib.h"
#include "gatt.h"
#include "gas.h"
+#include "log.h"
#include "manager.h"
static gint primary_uuid_cmp(gconstpointer a, gconstpointer b)
if (l)
gatt = l->data;
- return gas_register(device, gap ? &gap->range : NULL,
- gatt ? &gatt->range : NULL);
+ if (gap == NULL || gatt == NULL) {
+ error("GAP and GATT are mandatory");
+ return -EINVAL;
+ }
+
+ return gas_register(device, &gap->range, &gatt->range);
}
static void gatt_driver_remove(struct btd_device *device)