[PATCH 3/5] connector: Ensure callback entry is released
From: Matt Bennett
Date: Wed Jul 01 2020 - 20:28:11 EST
Currently the entry itself appears to be being leaked.
Signed-off-by: Matt Bennett <matt.bennett@xxxxxxxxxxxxxxxxxxx>
---
drivers/connector/cn_queue.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c
index 49295052ba8b..a82ceeb37f26 100644
--- a/drivers/connector/cn_queue.c
+++ b/drivers/connector/cn_queue.c
@@ -132,8 +132,10 @@ void cn_queue_free_dev(struct cn_queue_dev *dev)
struct cn_callback_entry *cbq, *n;
spin_lock_bh(&dev->queue_lock);
- list_for_each_entry_safe(cbq, n, &dev->queue_list, callback_entry)
+ list_for_each_entry_safe(cbq, n, &dev->queue_list, callback_entry) {
list_del(&cbq->callback_entry);
+ cn_queue_release_callback(cbq);
+ }
spin_unlock_bh(&dev->queue_lock);
while (atomic_read(&dev->refcnt)) {
--
2.27.0