wlan: Fix for address scheme for p2p device administrated.

When isP2pDeviceAddrAdministrated is set, derive the p2p mac address
from wlan mac address.

Change-Id: I5001f41f4d02b44862b7786ecba7ccad74c32a38
CRs-Fixed: 447768
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 31804f5..941ae7a 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -3816,26 +3816,32 @@
      if (pAdapter != NULL)
      {
 #ifdef WLAN_FEATURE_P2P
-         tANI_U8* p2p_dev_addr = wlan_hdd_get_intf_addr(pHddCtx);
-         if (p2p_dev_addr != NULL)
+         if ( pHddCtx->cfg_ini->isP2pDeviceAddrAdministrated )
          {
-             vos_mem_copy(&pHddCtx->p2pDeviceAddress.bytes[0],
-                           p2p_dev_addr, VOS_MAC_ADDR_SIZE);
+               vos_mem_copy( pHddCtx->p2pDeviceAddress.bytes,
+                       pHddCtx->cfg_ini->intfMacAddr[0].bytes,
+                       sizeof(tSirMacAddr));
 
-             if ( pHddCtx->cfg_ini->isP2pDeviceAddrAdministrated )
-             {
-                 /* Generate the P2P Device Address.  This consists of the device's
-                  * primary MAC address with the locally administered bit set.
-                  */
-                 pHddCtx->p2pDeviceAddress.bytes[0] |= 0x02;
-             }
+                /* Generate the P2P Device Address.  This consists of the device's
+                 * primary MAC address with the locally administered bit set.
+                */
+                pHddCtx->p2pDeviceAddress.bytes[0] |= 0x02;
          }
          else
          {
-             hddLog(VOS_TRACE_LEVEL_FATAL,
-                 "%s: Failed to allocate mac_address for p2p_device",
-                 __func__);
-             goto err_close_adapter;
+             tANI_U8* p2p_dev_addr = wlan_hdd_get_intf_addr(pHddCtx);
+             if (p2p_dev_addr != NULL)
+             {
+                 vos_mem_copy(&pHddCtx->p2pDeviceAddress.bytes[0],
+                             p2p_dev_addr, VOS_MAC_ADDR_SIZE);
+             }
+             else
+             {
+                   hddLog(VOS_TRACE_LEVEL_FATAL,
+                           "%s: Failed to allocate mac_address for p2p_device",
+                   __func__);
+                   goto err_close_adapter;
+             }
          }
 
          pP2pAdapter = hdd_open_adapter( pHddCtx, WLAN_HDD_P2P_DEVICE, "p2p%d",