wep_key_len = wep_key_len <= 5 ? 5 : 13;
wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
pwep = (struct ndis_802_11_wep *)rtw_malloc(wep_total_len);
- if (pwep == NULL) {
+ if (!pwep) {
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, (" wpa_set_encryption: pwep allocate fail !!!\n"));
goto exit;
}
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_MP_STATE)) { /* sta mode */
psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv));
- if (psta == NULL) {
+ if (!psta) {
;
} else {
if (strcmp(param->u.crypt.alg, "none") != 0)
}
}
pbcmc_sta = rtw_get_bcmc_stainfo(padapter);
- if (pbcmc_sta == NULL) {
+ if (!pbcmc_sta) {
;
} else {
/* Jeff: don't disable ieee8021x_blocked while clearing key */
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
#endif /* CONFIG_88EU_P2P */
- if ((ielen > MAX_WPA_IE_LEN) || (pie == NULL)) {
+ if (ielen > MAX_WPA_IE_LEN || !pie) {
_clr_fwstate_(&padapter->mlmepriv, WIFI_UNDER_WPS);
- if (pie == NULL)
+ if (!pie)
return ret;
else
return -EINVAL;
if (ielen) {
buf = rtw_zmalloc(ielen);
- if (buf == NULL) {
+ if (!buf) {
ret = -ENOMEM;
goto exit;
}
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct iw_mlme *mlme = (struct iw_mlme *)extra;
- if (mlme == NULL)
+ if (!mlme)
return -1;
DBG_88E("%s\n", __func__);
param_len = sizeof(struct ieee_param) + pext->key_len;
param = (struct ieee_param *)rtw_malloc(param_len);
- if (param == NULL)
+ if (!param)
return -1;
memset(param, 0, param_len);
bset = (u8)(p->flags & 0xFFFF);
len = p->length;
pparmbuf = (u8 *)rtw_malloc(len);
- if (pparmbuf == NULL) {
+ if (!pparmbuf) {
ret = -ENOMEM;
goto _rtw_mp_ioctl_hdl_exit;
}
DBG_88E("+rtw_get_aplist_info\n");
- if ((padapter->bDriverStopped) || (pdata == NULL)) {
+ if (padapter->bDriverStopped || !pdata) {
ret = -EINVAL;
goto exit;
}
int *pdata = (int *)wrqu;
int selector;
- if ((padapter->bDriverStopped) || (pdata == NULL)) {
+ if (padapter->bDriverStopped || !pdata) {
ret = -EINVAL;
goto exit;
}
goto exit;
}
- if ((padapter->bDriverStopped) || (pdata == NULL)) {
+ if (padapter->bDriverStopped || !pdata) {
ret = -EINVAL;
goto exit;
}
struct xmit_frame *xmit_frame;
xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
- if (xmit_frame == NULL) {
+ if (!xmit_frame) {
ret = -ENOMEM;
break;
}
struct xmit_frame *xmit_frame;
xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
- if (xmit_frame == NULL) {
+ if (!xmit_frame) {
ret = -ENOMEM;
break;
}
struct xmit_frame *xmit_frame;
xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
- if (xmit_frame == NULL) {
+ if (!xmit_frame) {
ret = -ENOMEM;
break;
}
struct xmit_frame *xmit_frame;
xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
- if (xmit_frame == NULL) {
+ if (!xmit_frame) {
ret = -ENOMEM;
break;
}
struct xmit_frame *xmit_frame;
xmit_frame = rtw_IOL_accquire_xmit_frame(padapter);
- if (xmit_frame == NULL) {
+ if (!xmit_frame) {
ret = -ENOMEM;
break;
}
}
param = (struct ieee_param *)rtw_malloc(p->length);
- if (param == NULL) {
+ if (!param) {
ret = -ENOMEM;
goto out;
}
u8 res = _SUCCESS;
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
- if (ph2c == NULL) {
+ if (!ph2c) {
res = _FAIL;
goto exit;
}
psetstakey_para = (struct set_stakey_parm *)rtw_zmalloc(sizeof(struct set_stakey_parm));
- if (psetstakey_para == NULL) {
+ if (!psetstakey_para) {
kfree(ph2c);
res = _FAIL;
goto exit;
DBG_88E("%s\n", __func__);
pcmd = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
- if (pcmd == NULL) {
+ if (!pcmd) {
res = _FAIL;
goto exit;
}
psetkeyparm = (struct setkey_parm *)rtw_zmalloc(sizeof(struct setkey_parm));
- if (psetkeyparm == NULL) {
+ if (!psetkeyparm) {
kfree(pcmd);
res = _FAIL;
goto exit;
}
}
- if (strcmp(param->u.crypt.alg, "none") == 0 && (psta == NULL)) {
+ if (strcmp(param->u.crypt.alg, "none") == 0 && !psta) {
/* todo:clear default encryption keys */
DBG_88E("clear default encryption keys, keyid =%d\n", param->u.crypt.idx);
goto exit;
}
- if (strcmp(param->u.crypt.alg, "WEP") == 0 && (psta == NULL)) {
+ if (strcmp(param->u.crypt.alg, "WEP") == 0 && !psta) {
DBG_88E("r871x_set_encryption, crypt.alg = WEP\n");
wep_key_idx = param->u.crypt.idx;
wep_key_len = param->u.crypt.key_len;
wep_key_len = wep_key_len <= 5 ? 5 : 13;
wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
pwep = (struct ndis_802_11_wep *)rtw_malloc(wep_total_len);
- if (pwep == NULL) {
+ if (!pwep) {
DBG_88E(" r871x_set_encryption: pwep allocate fail !!!\n");
goto exit;
}
if (ie_len > 0) {
pmlmepriv->wps_beacon_ie = rtw_malloc(ie_len);
pmlmepriv->wps_beacon_ie_len = ie_len;
- if (pmlmepriv->wps_beacon_ie == NULL) {
+ if (!pmlmepriv->wps_beacon_ie) {
DBG_88E("%s()-%d: rtw_malloc() ERROR!\n", __func__, __LINE__);
return -EINVAL;
}
if (ie_len > 0) {
pmlmepriv->wps_probe_resp_ie = rtw_malloc(ie_len);
pmlmepriv->wps_probe_resp_ie_len = ie_len;
- if (pmlmepriv->wps_probe_resp_ie == NULL) {
+ if (!pmlmepriv->wps_probe_resp_ie) {
DBG_88E("%s()-%d: rtw_malloc() ERROR!\n", __func__, __LINE__);
return -EINVAL;
}
if (ie_len > 0) {
pmlmepriv->wps_assoc_resp_ie = rtw_malloc(ie_len);
pmlmepriv->wps_assoc_resp_ie_len = ie_len;
- if (pmlmepriv->wps_assoc_resp_ie == NULL) {
+ if (!pmlmepriv->wps_assoc_resp_ie) {
DBG_88E("%s()-%d: rtw_malloc() ERROR!\n", __func__, __LINE__);
return -EINVAL;
}
}
param = (struct ieee_param *)rtw_malloc(p->length);
- if (param == NULL) {
+ if (!param) {
ret = -ENOMEM;
goto out;
}
pmlmepriv->wps_probe_req_ie = NULL;
pmlmepriv->wps_probe_req_ie = rtw_malloc(cp_sz);
- if (pmlmepriv->wps_probe_req_ie == NULL) {
+ if (!pmlmepriv->wps_probe_req_ie) {
pr_info("%s()-%d: rtw_malloc() ERROR!\n", __func__, __LINE__);
ret = -EINVAL;
goto FREE_EXT;
err = 0;
data = _rtw_zmalloc(EFUSE_BT_MAX_MAP_LEN);
- if (data == NULL) {
+ if (!data) {
err = -ENOMEM;
goto exit;
}
rawdata = _rtw_zmalloc(EFUSE_BT_MAX_MAP_LEN);
- if (rawdata == NULL) {
+ if (!rawdata) {
err = -ENOMEM;
goto exit;
}
sprintf(extra + strlen(extra), "\n");
}
} else if (strcmp(tmp[0], "rmap") == 0) {
- if ((tmp[1] == NULL) || (tmp[2] == NULL)) {
+ if (!tmp[1] || !tmp[2]) {
DBG_88E("%s: rmap Fail!! Parameters error!\n", __func__);
err = -EINVAL;
goto exit;
sprintf(extra + strlen(extra), "\n");
}
} else if (strcmp(tmp[0], "btrmap") == 0) {
- if ((tmp[1] == NULL) || (tmp[2] == NULL)) {
+ if (!tmp[1] || !tmp[2]) {
err = -EINVAL;
goto exit;
}
pEfuseHal = &haldata->EfuseHal;
err = 0;
setdata = _rtw_zmalloc(1024);
- if (setdata == NULL) {
+ if (!setdata) {
err = -ENOMEM;
goto exit;
}
ShadowMapBT = _rtw_malloc(EFUSE_BT_MAX_MAP_LEN);
- if (ShadowMapBT == NULL) {
+ if (!ShadowMapBT) {
err = -ENOMEM;
goto exit;
}
ShadowMapWiFi = _rtw_malloc(EFUSE_MAP_SIZE);
- if (ShadowMapWiFi == NULL) {
+ if (!ShadowMapWiFi) {
err = -ENOMEM;
goto exit;
}
setrawdata = _rtw_malloc(EFUSE_MAX_SIZE);
- if (setrawdata == NULL) {
+ if (!setrawdata) {
err = -ENOMEM;
goto exit;
}
/* tmp[0],[1],[2] */
/* wmap, addr, 00e04c871200 */
if (strcmp(tmp[0], "wmap") == 0) {
- if ((tmp[1] == NULL) || (tmp[2] == NULL)) {
+ if (!tmp[1] || !tmp[2]) {
err = -EINVAL;
goto exit;
}
goto exit;
}
} else if (strcmp(tmp[0], "wraw") == 0) {
- if ((tmp[1] == NULL) || (tmp[2] == NULL)) {
+ if (!tmp[1] || !tmp[2]) {
err = -EINVAL;
goto exit;
}
goto exit;
}
} else if (strcmp(tmp[0], "mac") == 0) {
- if (tmp[1] == NULL) {
+ if (!tmp[1]) {
err = -EINVAL;
goto exit;
}
goto exit;
}
} else if (strcmp(tmp[0], "vidpid") == 0) {
- if (tmp[1] == NULL) {
+ if (!tmp[1]) {
err = -EINVAL;
goto exit;
}
goto exit;
}
} else if (strcmp(tmp[0], "btwmap") == 0) {
- if ((tmp[1] == NULL) || (tmp[2] == NULL)) {
+ if (!tmp[1] || !tmp[2]) {
err = -EINVAL;
goto exit;
}
goto exit;
}
} else if (strcmp(tmp[0], "btwfake") == 0) {
- if ((tmp[1] == NULL) || (tmp[2] == NULL)) {
+ if (!tmp[1] || !tmp[2]) {
err = -EINVAL;
goto exit;
}
goto exit;
}
} else if (strcmp(tmp[0], "wlwfake") == 0) {
- if ((tmp[1] == NULL) || (tmp[2] == NULL)) {
+ if (!tmp[1] || !tmp[2]) {
err = -EINVAL;
goto exit;
}
pch = extra;
pnext = strpbrk(pch, ",.-");
- if (pnext == NULL)
+ if (!pnext)
return -EINVAL;
*pnext = 0;
width_str = pch;
pch = pnext + 1;
pnext = strpbrk(pch, ",.-");
- if (pnext == NULL)
+ if (!pnext)
return -EINVAL;
*pnext = 0;
addr = simple_strtoul(pch, &ptmp, 16);
pch = input;
pnext = strpbrk(pch, ",.-");
- if (pnext == NULL) {
+ if (!pnext) {
kfree(input);
return -EINVAL;
}
u32 subcmd = wrqu->flags;
struct adapter *padapter = rtw_netdev_priv(dev);
- if (padapter == NULL)
+ if (!padapter)
return -ENETDOWN;
- if (extra == NULL) {
+ if (!extra) {
wrqu->length = 0;
return -EIO;
}
u32 subcmd = wrqu->flags;
struct adapter *padapter = rtw_netdev_priv(dev);
- if (padapter == NULL)
+ if (!padapter)
return -ENETDOWN;
- if (extra == NULL) {
+ if (!extra) {
wrqu->length = 0;
return -EIO;
}
len = wrqu->data.length;
pbuf = (u8 *)rtw_zmalloc(len);
- if (pbuf == NULL) {
+ if (!pbuf) {
DBG_88E("%s: no memory!\n", __func__);
return -ENOMEM;
}
ptmp = (char *)pbuf;
pch = strsep(&ptmp, delim);
- if ((pch == NULL) || (strlen(pch) == 0)) {
+ if (!pch || strlen(pch) == 0) {
kfree(pbuf);
DBG_88E("%s: parameter error(level 1)!\n", __func__);
return -EFAULT;