From b33cb20a2b2fd45654937979d045321a115431f9 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 13 Nov 2015 17:48:48 +0200 Subject: [PATCH] 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. --- profiles/input/hog.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.47.3