Browse Source

qcacld-3.0: Fix the ndi set failure in case of non-random mac

Currently in host driver, for non-random mac addr, ndi mac addr
pointer is null, so, hdd_ndi_set_mode function returns error.

To fix this, dynamic mac address is updated for only randomized mac
in hdd_ndi_set_mode function. Thus, null pointer check is removed
and function does not return the error.

CRs-Fixed: 3243783
Change-Id: I27fff615ec66acfd86bd13449b79b0d36469803f
Rahul Gusain 2 years ago
parent
commit
5b5098762d
1 changed files with 4 additions and 10 deletions
  1. 4 10
      core/hdd/src/wlan_hdd_nan_datapath.c

+ 4 - 10
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -759,18 +759,12 @@ int hdd_ndi_set_mode(const char *iface_name)
 			return -EFAULT;
 		}
 		ndi_mac_addr = &random_ndi_mac.bytes[0];
+		hdd_update_dynamic_mac(hdd_ctx, &adapter->mac_addr,
+				       (struct qdf_mac_addr *)ndi_mac_addr);
+		qdf_mem_copy(&adapter->mac_addr, ndi_mac_addr, ETH_ALEN);
+		qdf_mem_copy(adapter->dev->dev_addr, ndi_mac_addr, ETH_ALEN);
 	}
 
-	if (!ndi_mac_addr) {
-		hdd_err("ndi mac address is null");
-		return -EINVAL;
-	}
-
-	hdd_update_dynamic_mac(hdd_ctx, &adapter->mac_addr,
-			       (struct qdf_mac_addr *)ndi_mac_addr);
-	qdf_mem_copy(&adapter->mac_addr, ndi_mac_addr, ETH_ALEN);
-	qdf_mem_copy(adapter->dev->dev_addr, ndi_mac_addr, ETH_ALEN);
-
 	adapter->device_mode = QDF_NDI_MODE;
 	hdd_debug("Created NDI with device mode:%d and iface_name:%s",
 		  adapter->device_mode, iface_name);