Forráskód Böngészése

qcacld-3.0: Fix class create pointer issue

Previous code change results in incorrect pointer
assignment for class variable. Fix this by returning
class_create value, and explicitly assigning class
to this value.

Change-Id: I8fd53fe0c6825cf6bdf4786ca2788044d71a8e86
CRs-Fixed: 3638971
Mohammed Ahmed 1 éve
szülő
commit
3a5f23ae61
1 módosított fájl, 5 hozzáadás és 5 törlés
  1. 5 5
      core/hdd/src/wlan_hdd_main.c

+ 5 - 5
core/hdd/src/wlan_hdd_main.c

@@ -18823,14 +18823,14 @@ const struct file_operations wlan_hdd_state_fops = {
 };
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0))
-static void wlan_hdd_class_create(struct class *class_input, const char *name)
+static struct class *wlan_hdd_class_create(const char *name)
 {
-	class_input = class_create(THIS_MODULE, name);
+	return class_create(THIS_MODULE, name);
 }
 #else
-static void wlan_hdd_class_create(struct class *class_input, const char *name)
+static struct class *wlan_hdd_class_create(const char *name)
 {
-	class_input = class_create(name);
+	return class_create(name);
 }
 #endif
 
@@ -18851,7 +18851,7 @@ static int  wlan_hdd_state_ctrl_param_create(void)
 		goto dev_alloc_err;
 	}
 	wlan_hdd_state_major = MAJOR(device);
-	wlan_hdd_class_create(class, WLAN_CTRL_NAME);
+	class = wlan_hdd_class_create(WLAN_CTRL_NAME);
 	if (IS_ERR(class)) {
 		pr_err("wlan_hdd_state class_create error");
 		goto class_err;