Переглянути джерело

qcacld-3.0: Abort hdd_update_tgt_cfg on pdev failure

Currently, hdd_update_tgt_cfg() continues execution if allocation of the
pdev object fails. Unsurprisingly, this leads to numerous access issues.
Abort hdd_update_tgt_cfg() if allocation of the pdev fails.

Change-Id: I1c820994510a10949ef546cac06a8eb97ca0adf1
CRs-Fixed: 2297412
Dustin Brown 6 роки тому
батько
коміт
64204d2ddc
1 змінених файлів з 12 додано та 9 видалено
  1. 12 9
      core/hdd/src/wlan_hdd_main.c

+ 12 - 9
core/hdd/src/wlan_hdd_main.c

@@ -1905,15 +1905,18 @@ void hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
 	}
 	ret = hdd_objmgr_create_and_store_pdev(hdd_ctx);
 	if (ret) {
-		hdd_err("Failed to create pdev; errno:%d", ret);
-		QDF_BUG(0);
-	} else {
-		hdd_debug("New pdev has been created with pdev_id = %u",
-			  hdd_ctx->hdd_pdev->pdev_objmgr.wlan_pdev_id);
-		if (dispatcher_pdev_open(hdd_ctx->hdd_pdev)) {
-			hdd_err("dispatcher pdev open failed");
-			QDF_BUG(0);
-		}
+		QDF_DEBUG_PANIC("Failed to create pdev; errno:%d", ret);
+		return;
+	}
+
+	hdd_debug("New pdev has been created with pdev_id = %u",
+		  hdd_ctx->hdd_pdev->pdev_objmgr.wlan_pdev_id);
+
+	status = dispatcher_pdev_open(hdd_ctx->hdd_pdev);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		QDF_DEBUG_PANIC("dispatcher pdev open failed; status:%d",
+				status);
+		return;
 	}
 
 	cdp_pdev_set_ctrl_pdev(cds_get_context(QDF_MODULE_ID_SOC),