if (pstrAddStationMsg->u8NumRates > 0) {
u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL);
- WILC_NULLCHECK(s32Error, rates);
+ if (!rates)
+ return -ENOMEM;
memcpy(rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates);
pstrAddStationMsg->pu8Rates = rates;
if (pstrAddStationMsg->u8NumRates > 0) {
u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL);
- WILC_NULLCHECK(s32Error, rates);
+ if (!rates)
+ return -ENOMEM;
+
memcpy(rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates);
pstrAddStationMsg->pu8Rates = rates;
}
#include "wilc_msgqueue.h"
#include <linux/spinlock.h>
+#include <linux/errno.h>
/*!
* @author syounan
/* construct a new message */
pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC);
- WILC_NULLCHECK(s32RetStatus, pstrMessage);
+ if (!pstrMessage)
+ return -ENOMEM;
pstrMessage->u32Length = u32SendBufferSize;
pstrMessage->pstrNext = NULL;
pstrMessage->pvBuffer = kmalloc(u32SendBufferSize, GFP_ATOMIC);
- WILC_NULLCHECK(s32RetStatus, pstrMessage->pvBuffer);
+ if (!pstrMessage->pvBuffer) {
+ s32RetStatus = -ENOMEM;
+ goto ERRORHANDLER;
+ }
memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize);
/* add it to the message queue */
#ifdef WILC_SDIO
#include "linux_wlan_sdio.h" /* tony : for set_wiphy_dev() */
#endif
-
+#include <linux/errno.h>
#define IS_MANAGMEMENT 0x100
#define IS_MANAGMEMENT_CALLBACK 0x080
if (priv->bCfgScanning == true) {
if (enuScanEvent == SCAN_EVENT_NETWORK_FOUND) {
wiphy = priv->dev->ieee80211_ptr->wiphy;
- WILC_NULLCHECK(s32Error, wiphy);
+
+ if (!wiphy)
+ return;
+
if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC
&&
((((s32)pstrNetworkInfo->s8rssi) * 100) < 0
s32Freq = ieee80211_channel_to_frequency((s32)pstrNetworkInfo->u8channel, IEEE80211_BAND_2GHZ);
channel = ieee80211_get_channel(wiphy, s32Freq);
- WILC_NULLCHECK(s32Error, channel);
+ if (!channel)
+ return;
PRINT_INFO(CFG80211_DBG, "Network Info:: CHANNEL Frequency: %d, RSSI: %d, CapabilityInfo: %d,"
"BeaconPeriod: %d\n", channel->center_freq, (((s32)pstrNetworkInfo->s8rssi) * 100),
struct wilc_priv *priv;
u8 NullBssid[ETH_ALEN] = {0};
-
- WILC_NULLCHECK(s32Error, wiphy);
+ if (!wiphy)
+ return -EFAULT;
priv = wiphy_priv(wiphy);
tstrWILC_AddStaParam strStaParams = { {0} };
perInterface_wlan_t *nic;
-
- WILC_NULLCHECK(s32Error, wiphy);
+ if (!wiphy)
+ return -EFAULT;
priv = wiphy_priv(wiphy);
nic = netdev_priv(dev);
struct wilc_priv *priv;
perInterface_wlan_t *nic;
- WILC_NULLCHECK(s32Error, wiphy);
+ if (!wiphy)
+ return -EFAULT;
priv = wiphy_priv(wiphy);
nic = netdev_priv(dev);
PRINT_D(HOSTAPD_DBG, "Change station paramters\n");
- WILC_NULLCHECK(s32Error, wiphy);
+ if (!wiphy)
+ return -EFAULT;
priv = wiphy_priv(wiphy);
nic = netdev_priv(dev);