Browse Source

qcacld-3.0: Cleanup mlo interfaces properly

Currently mlo interfaces are not getting cleaned up properly
during virtual interface delete. During the driver unload
sequence host is cleaning up these link adapters but not
removing the DSC vdevs associated with these which leads
to memory leakage.

To address this issue, de-initialize and close link adapters
during virtual interface delete properly.

Change-Id: I427b9ef5ec82b4ad651bd6d4a36b9fef3f120c99
CRs-Fixed: 3515367
Asutosh Mohapatra 1 year ago
parent
commit
9b91648905
2 changed files with 39 additions and 0 deletions
  1. 1 0
      core/hdd/src/wlan_hdd_mlo.c
  2. 38 0
      core/hdd/src/wlan_hdd_p2p.c

+ 1 - 0
core/hdd/src/wlan_hdd_mlo.c

@@ -152,6 +152,7 @@ QDF_STATUS hdd_wlan_unregister_mlo_interfaces(struct hdd_adapter *adapter,
 		link_adapter = mlo_adapter_info->link_adapter[i];
 		if (!link_adapter)
 			continue;
+		hdd_cleanup_conn_info(link_adapter->deflink);
 		ucfg_dp_destroy_intf(link_adapter->hdd_ctx->psoc,
 				     &link_adapter->mac_addr);
 		hdd_remove_adapter(link_adapter->hdd_ctx, link_adapter);

+ 38 - 0
core/hdd/src/wlan_hdd_p2p.c

@@ -870,12 +870,50 @@ struct wireless_dev *wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
 }
 #endif
 
+#if defined(WLAN_FEATURE_11BE_MLO)
+/**
+ * hdd_deinit_mlo_interfaces() - De-initialize link adapters
+ * @hdd_ctx: Pointer to hdd context
+ * @adapter: Pointer to adapter
+ * @rtnl_held: rtnl lock
+ *
+ * Return: None
+ */
+static void hdd_deinit_mlo_interfaces(struct hdd_context *hdd_ctx,
+				      struct hdd_adapter *adapter,
+				      bool rtnl_held)
+{
+	int i;
+	struct hdd_mlo_adapter_info *mlo_adapter_info;
+	struct hdd_adapter *link_adapter;
+
+	mlo_adapter_info = &adapter->mlo_adapter_info;
+	for (i = 0; i < WLAN_MAX_MLD; i++) {
+		link_adapter = mlo_adapter_info->link_adapter[i];
+		if (!link_adapter)
+			continue;
+		hdd_deinit_adapter(hdd_ctx, link_adapter, rtnl_held);
+	}
+}
+#else
+static inline
+void hdd_deinit_mlo_interfaces(struct hdd_context *hdd_ctx,
+			       struct hdd_adapter *adapter,
+			       bool rtnl_held)
+{
+}
+#endif
+
 void hdd_clean_up_interface(struct hdd_context *hdd_ctx,
 			    struct hdd_adapter *adapter)
 {
 	wlan_hdd_release_intf_addr(hdd_ctx,
 				   adapter->mac_addr.bytes);
 	hdd_stop_adapter(hdd_ctx, adapter);
+	if (hdd_adapter_is_ml_adapter(adapter)) {
+		hdd_deinit_mlo_interfaces(hdd_ctx, adapter, true);
+		hdd_wlan_unregister_mlo_interfaces(adapter, true);
+	}
 	hdd_deinit_adapter(hdd_ctx, adapter, true);
 	hdd_close_adapter(hdd_ctx, adapter, true);
 }