Kaynağa Gözat

qcacld-3.0: SSR protection for linux/crda reg_notifier api

qcacld-2.0 to qcacld-3.0 propagation

if SSR trigger in middle of execution of linux_reg_notifier
/crda_reg_notifier, driver may access uninitialized data.
Hence Driver need to protect these function from SSR.

Change-Id: I9bdc6851a44fecc8353e94b38eb1dd4f63e58604
CRs-Fixed: 798672
Mukul Sharma 9 yıl önce
ebeveyn
işleme
c7a59f3210
1 değiştirilmiş dosya ile 17 ekleme ve 2 silme
  1. 17 2
      core/cds/src/cds_reg_service.c

+ 17 - 2
core/cds/src/cds_reg_service.c

@@ -1208,13 +1208,13 @@ static void restore_custom_reg_settings(struct wiphy *wiphy)
 #endif
 
 /**
- * hdd_reg_notifier() - regulatory notifier
+ * __hdd_reg_notifier() - regulatory notifier
  * @wiphy: wiphy
  * @request: regulatory request
  *
  * Return: void or int
  */
-void hdd_reg_notifier(struct wiphy *wiphy,
+void __hdd_reg_notifier(struct wiphy *wiphy,
 		      struct regulatory_request *request)
 {
 	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
@@ -1359,6 +1359,21 @@ void hdd_reg_notifier(struct wiphy *wiphy,
 	return;
 }
 
+/**
+ * hdd_reg_notifier() - regulatory notifier
+ * @wiphy: wiphy
+ * @request: regulatory request
+ *
+ * Return: void or int
+ */
+void hdd_reg_notifier(struct wiphy *wiphy,
+		      struct regulatory_request *request)
+{
+	cds_ssr_protect(__func__);
+	__hdd_reg_notifier(wiphy, request);
+	cds_ssr_unprotect(__func__);
+}
+
 /**
  * cds_regulatory_init() - regulatory_init
  * Return: CDF_STATUS