浏览代码

qcacld-3.0: Validate hif ctx during shutdown

In function wlan_hdd_shutdown, hif_ctx is not validated
before use in hif_disable_isr. This can lead to a null pointer exception
in certain situations.
Validate hif_ctx before use in shutdown function.

Change-Id: Id50d87378ee176f6a48a790ec7027994aef0adf8
CRs-Fixed: 1083020
Manjeet Singh 8 年之前
父节点
当前提交
6d2641a934
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      core/hdd/src/wlan_hdd_driver_ops.c

+ 4 - 1
core/hdd/src/wlan_hdd_driver_ops.c

@@ -450,7 +450,10 @@ static void wlan_hdd_shutdown(void)
 		hdd_err("Host is not ready for SSR, attempting anyway");
 		hdd_err("Host is not ready for SSR, attempting anyway");
 
 
 	if (!QDF_IS_EPPING_ENABLED(cds_get_conparam())) {
 	if (!QDF_IS_EPPING_ENABLED(cds_get_conparam())) {
-		hif_disable_isr(hif_ctx);
+		if (!hif_ctx)
+			hdd_err("Invalid hif ctx!");
+		else
+			hif_disable_isr(hif_ctx);
 		hdd_wlan_shutdown();
 		hdd_wlan_shutdown();
 	}
 	}
 }
 }