Эх сурвалжийг харах

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
Jeff Johnson 8 жил өмнө
parent
commit
0d26ae673f

+ 2 - 1
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);
 }