浏览代码

qcacld-3.0: Check for hdd_ctx being NULL

In function hdd_register_rx_ol, hdd_ctx is retruned by cds_get_context.
Check for hdd_ctx being NULL before de-referencing it.

Change-Id: I5e45036930a03368310871d108062c2d24742602
CRs-Fixed: 2299782
Amar Singhal 6 年之前
父节点
当前提交
cc5a4ec63d
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      core/hdd/src/wlan_hdd_tx_rx.c

+ 3 - 1
core/hdd/src/wlan_hdd_tx_rx.c

@@ -1653,8 +1653,10 @@ static void hdd_register_rx_ol(void)
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
-	if  (!hdd_ctx)
+	if  (!hdd_ctx) {
 		hdd_err("HDD context is NULL");
+		return;
+	}
 
 	hdd_ctx->en_tcp_delack_no_lro = 0;