From 0d26ae673fb217bfba42b5ad0edf66653d666719 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 10 Mar 2017 11:01:53 -0800 Subject: [PATCH] qcacld-3.0: Fix HDD scan cleanup issues While addressing the issue fixed by change "qcacld-3.0: Cleanup scan queue during driver unload" a couple of issues were observed in the HDD scan cleanup code: 1) list node was directly typecast to hdd_scan_req instead of using container_of() operation. 2) hdd_scan_req_q_lock spinlock was not being destroyed. Address these issues. Change-Id: I6d1e7f5a78848d43e62f893b82f538b960ea0609 CRs-Fixed: 2018045 --- core/hdd/src/wlan_hdd_scan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 3cb76b618c..01abd6fce3 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -3110,7 +3110,7 @@ void hdd_cleanup_scan_queue(hdd_context_t *hdd_ctx) return; } qdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock); - hdd_scan_req = (struct hdd_scan_req *)node; + hdd_scan_req = container_of(node, struct hdd_scan_req, node); req = hdd_scan_req->scan_request; source = hdd_scan_req->source; adapter = hdd_scan_req->adapter; @@ -3145,6 +3145,7 @@ void hdd_scan_context_destroy(hdd_context_t *hdd_ctx) { #ifndef NAPIER_SCAN qdf_list_destroy(&hdd_ctx->hdd_scan_req_q); + qdf_spinlock_destroy(&hdd_ctx->hdd_scan_req_q_lock); #endif qdf_spinlock_destroy(&hdd_ctx->sched_scan_lock); }