summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-11-13 17:48:48 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-11-13 17:51:17 +0200
commitb33cb20a2b2fd45654937979d045321a115431f9 (patch)
tree322dacb79d1fbfa0b7dfc55669de9353d7e8c16b /profiles
parent4b5f85c93896a89a112b139db23ddd97a1bc1654 (diff)
downloadbluez-b33cb20a2b2fd45654937979d045321a115431f9.tar.gz
input/hog: Fix not reseting queue to NULL after destroying it
This can cause crashes as the data pointed by devices if a new device is probed it would most likely access invalid memory.
Diffstat (limited to 'profiles')
-rw-r--r--profiles/input/hog.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index 935a920fb..4dba83f71 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -132,8 +132,10 @@ static void hog_device_free(void *data)
struct hog_device *dev = data;
queue_remove(devices, dev);
- if (queue_isempty(devices))
+ if (queue_isempty(devices)) {
queue_destroy(devices, NULL);
+ devices = NULL;
+ }
btd_device_remove_attio_callback(dev->device, dev->attioid);
btd_device_unref(dev->device);