From: Abhishek Chandra Date: Mon, 13 Aug 2018 09:06:49 +0000 (+0530) Subject: Notification was faling as Gatt serv info was NULL X-Git-Tag: accepted/tizen/unified/20180821.090920~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git;a=commitdiff_plain;h=f70886941dd22c098f03c5aaecce927e4ce210ad Notification was faling as Gatt serv info was NULL String pointer were compaired for the path in __bt_gatt_get_service_state , which was causing the API to return NULL. Fix : string compairition for service path is used. Change-Id: I5ec7d768f9a63780cbc18ef1f8b00c31542c3adc Signed-off-by: Abhishek Chandra --- diff --git a/bt-oal/bluez_hal/src/bt-hal-gatt-server.c b/bt-oal/bluez_hal/src/bt-hal-gatt-server.c index fa29c69..b95d6a4 100644 --- a/bt-oal/bluez_hal/src/bt-hal-gatt-server.c +++ b/bt-oal/bluez_hal/src/bt-hal-gatt-server.c @@ -2638,11 +2638,12 @@ static gboolean __bt_gatt_get_service_state(const char *service_path) { struct gatt_service_info *svc_info = NULL; GSList *l = NULL; - for (l = gatt_services; l; l = g_slist_next(l)) { svc_info = (struct gatt_service_info *)l->data; - if (svc_info->serv_path == service_path) { + + + if (!g_strcmp0(svc_info->serv_path, service_path)) { DBG("Return the state of the gatt service %d", svc_info->is_svc_registered); return svc_info->is_svc_registered;