qcacld-3.0: Set hdd context to null when its freed

HDD context in gp_cds_context is not getting reset to null during
driver remove callback when hdd context is destroyed. Set HDD context
to null to avoid any use after free.

Change-Id: Ifbeaca139ed44f871266a11f4b9e973961e26cc8
CRs-Fixed: 2119187
This commit is contained in:
Rajeev Kumar 2017-09-29 14:01:24 -07:00 • committed by snandini
commit 493a31be99

View file

@ -5865,6 +5865,7 @@ static int hdd_context_deinit(struct hdd_context *hdd_ctx)
*/
static void hdd_context_destroy(struct hdd_context *hdd_ctx)
{
cds_set_context(QDF_MODULE_ID_HDD, NULL);
wlan_hdd_deinit_tx_rx_histogram(hdd_ctx);
@ -7782,8 +7783,6 @@ static struct hdd_context *hdd_context_create(struct device *dev)
hdd_override_ini_config(hdd_ctx);
cds_set_context(QDF_MODULE_ID_HDD, hdd_ctx);
ret = hdd_context_init(hdd_ctx);
if (ret)
@ -7811,6 +7810,8 @@ static struct hdd_context *hdd_context_create(struct device *dev)
skip_multicast_logging:
hdd_set_trace_level_for_each(hdd_ctx);
cds_set_context(QDF_MODULE_ID_HDD, hdd_ctx);
EXIT();
return hdd_ctx;