From 31fa4c92d1825004e8a64fb513f5ab5e04fd2dea Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 30 Jun 2014 16:47:52 +0300 Subject: [PATCH] android/hog: Fix not resetting properly on detach --- android/hog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/hog.c b/android/hog.c index abc625cdf..c094f723f 100644 --- a/android/hog.c +++ b/android/hog.c @@ -1007,7 +1007,10 @@ void bt_hog_detach(struct bt_hog *hog) for (l = hog->reports; l; l = l->next) { struct report *r = l->data; - g_attrib_unregister(hog->attrib, r->notifyid); + if (r->notifyid > 0) { + g_attrib_unregister(hog->attrib, r->notifyid); + r->notifyid = 0; + } } if (hog->scpp)