prima: Code refactoring in SAP start.

This fix contains following changes
1. Remove redundant vos_mem_zero and vos_mem_copy,
2. Add NULL check for function param and
3. Add Linux Version code for function call

Change-Id: I757a2e14358403b7950868fd81d8e58ab3f829df
CRs-Fixed: 796971
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 13a5d2f..4f98626 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -7423,10 +7423,10 @@
 
     ENTER();
 
-    if (NULL == dev)
+    if (NULL == dev || NULL == params)
     {
         VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
-                   "%s: Device is Null", __func__);
+                   "%s: Device or params is Null", __func__);
         return -ENODEV;
     }
 
@@ -7478,7 +7478,16 @@
             return -EALREADY;
         }
 
-        status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, &new, &params->beacon, params->dtim_period);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
+        status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter,
+                                                    &new,
+                                                    &params->beacon);
+#else
+        status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter,
+                                                    &new,
+                                                    &params->beacon,
+                                                    params->dtim_period);
+#endif
 
         if (status != 0)
         {