Quellcode durchsuchen

qcacld-3.0: Cleanup error handling in hdd_configure_cds

Error paths were missing cleanup steps.

Change-Id: I9178e795f1ff9c3439c3ad43957d111e590f0603
CRs-Fixed: 1079503
Houston Hoffman vor 8 Jahren
Ursprung
Commit
8d1a6f09c8
1 geänderte Dateien mit 10 neuen und 3 gelöschten Zeilen
  1. 10 3
      core/hdd/src/wlan_hdd_main.c

+ 10 - 3
core/hdd/src/wlan_hdd_main.c

@@ -7669,22 +7669,29 @@ int hdd_configure_cds(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
 	status = hdd_post_cds_enable_config(hdd_ctx);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		hdd_alert("hdd_post_cds_enable_config failed");
-		goto out;
+		goto cds_disable;
 	}
 
 	ret = hdd_features_init(hdd_ctx, adapter);
 	if (ret)
-		goto out;
+		goto cds_disable;
 
 	sme_cbacks.sme_get_valid_channels = sme_get_cfg_valid_channels;
 	sme_cbacks.sme_get_nss_for_vdev = sme_get_vdev_type_nss;
 	status = cds_init_policy_mgr(&sme_cbacks);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		hdd_err("Policy manager initialization failed");
-		goto out;
+		goto hdd_features_deinit;
 	}
 
 	return 0;
+
+hdd_features_deinit:
+	hdd_deregister_cb(hdd_ctx);
+	wlan_hdd_cfg80211_deregister_frames(adapter);
+cds_disable:
+	cds_disable(hdd_ctx->pcds_context);
+
 out:
 	return -EINVAL;
 }