Commit fadbe0cd authored by navin patidar's avatar navin patidar Committed by Greg Kroah-Hartman

staging: rtl8188eu:Remove rtw_zmalloc(), wrapper for kzalloc()

Signed-off-by: default avatarnavin patidar <navin.patidar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a733e467
This diff is collapsed.
...@@ -103,7 +103,7 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf) ...@@ -103,7 +103,7 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf)
u16 efuse_utilized = 0; u16 efuse_utilized = 0;
u8 u1temp = 0; u8 u1temp = 0;
efuseTbl = (u8 *)rtw_zmalloc(EFUSE_MAP_LEN_88E); efuseTbl = kzalloc(EFUSE_MAP_LEN_88E, GFP_KERNEL);
if (efuseTbl == NULL) { if (efuseTbl == NULL) {
DBG_88E("%s: alloc efuseTbl fail!\n", __func__); DBG_88E("%s: alloc efuseTbl fail!\n", __func__);
goto exit; goto exit;
...@@ -1083,7 +1083,7 @@ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data) ...@@ -1083,7 +1083,7 @@ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data)
if ((addr + cnts) > mapLen) if ((addr + cnts) > mapLen)
return _FAIL; return _FAIL;
map = rtw_zmalloc(mapLen); map = kzalloc(mapLen, GFP_KERNEL);
if (map == NULL) if (map == NULL)
return _FAIL; return _FAIL;
......
...@@ -1666,13 +1666,13 @@ int rtw_set_auth(struct adapter *adapter, struct security_priv *psecuritypriv) ...@@ -1666,13 +1666,13 @@ int rtw_set_auth(struct adapter *adapter, struct security_priv *psecuritypriv)
struct cmd_priv *pcmdpriv = &(adapter->cmdpriv); struct cmd_priv *pcmdpriv = &(adapter->cmdpriv);
int res = _SUCCESS; int res = _SUCCESS;
pcmd = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); pcmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (pcmd == NULL) { if (pcmd == NULL) {
res = _FAIL; /* try again */ res = _FAIL; /* try again */
goto exit; goto exit;
} }
psetauthparm = (struct setauth_parm *)rtw_zmalloc(sizeof(struct setauth_parm)); psetauthparm = kzalloc(sizeof(struct setauth_parm), GFP_KERNEL);
if (psetauthparm == NULL) { if (psetauthparm == NULL) {
kfree(pcmd); kfree(pcmd);
res = _FAIL; res = _FAIL;
...@@ -1703,11 +1703,11 @@ int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, in ...@@ -1703,11 +1703,11 @@ int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, in
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
int res = _SUCCESS; int res = _SUCCESS;
pcmd = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); pcmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (pcmd == NULL) if (pcmd == NULL)
return _FAIL; /* try again */ return _FAIL; /* try again */
psetkeyparm = (struct setkey_parm *)rtw_zmalloc(sizeof(struct setkey_parm)); psetkeyparm = kzalloc(sizeof(struct setkey_parm), GFP_KERNEL);
if (psetkeyparm == NULL) { if (psetkeyparm == NULL) {
res = _FAIL; res = _FAIL;
goto err_free_cmd; goto err_free_cmd;
......
...@@ -7055,12 +7055,12 @@ void report_survey_event(struct adapter *padapter, ...@@ -7055,12 +7055,12 @@ void report_survey_event(struct adapter *padapter,
pcmdpriv = &padapter->cmdpriv; pcmdpriv = &padapter->cmdpriv;
pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (pcmd_obj == NULL) if (pcmd_obj == NULL)
return; return;
cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header)); cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header));
pevtcmd = (u8 *)rtw_zmalloc(cmdsz); pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
if (pevtcmd == NULL) { if (pevtcmd == NULL) {
kfree(pcmd_obj); kfree(pcmd_obj);
return; return;
...@@ -7107,12 +7107,12 @@ void report_surveydone_event(struct adapter *padapter) ...@@ -7107,12 +7107,12 @@ void report_surveydone_event(struct adapter *padapter)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (pcmd_obj == NULL) if (pcmd_obj == NULL)
return; return;
cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header)); cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header));
pevtcmd = (u8 *)rtw_zmalloc(cmdsz); pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
if (pevtcmd == NULL) { if (pevtcmd == NULL) {
kfree(pcmd_obj); kfree(pcmd_obj);
return; return;
...@@ -7153,12 +7153,12 @@ void report_join_res(struct adapter *padapter, int res) ...@@ -7153,12 +7153,12 @@ void report_join_res(struct adapter *padapter, int res)
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (pcmd_obj == NULL) if (pcmd_obj == NULL)
return; return;
cmdsz = (sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header)); cmdsz = (sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header));
pevtcmd = (u8 *)rtw_zmalloc(cmdsz); pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
if (pevtcmd == NULL) { if (pevtcmd == NULL) {
kfree(pcmd_obj); kfree(pcmd_obj);
return; return;
...@@ -7206,12 +7206,12 @@ void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, unsi ...@@ -7206,12 +7206,12 @@ void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, unsi
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (pcmd_obj == NULL) if (pcmd_obj == NULL)
return; return;
cmdsz = (sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header)); cmdsz = (sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header));
pevtcmd = (u8 *)rtw_zmalloc(cmdsz); pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
if (pevtcmd == NULL) { if (pevtcmd == NULL) {
kfree(pcmd_obj); kfree(pcmd_obj);
return; return;
...@@ -7261,12 +7261,12 @@ void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, int ...@@ -7261,12 +7261,12 @@ void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, int
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (pcmd_obj == NULL) if (pcmd_obj == NULL)
return; return;
cmdsz = (sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header)); cmdsz = (sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header));
pevtcmd = (u8 *)rtw_zmalloc(cmdsz); pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
if (pevtcmd == NULL) { if (pevtcmd == NULL) {
kfree(pcmd_obj); kfree(pcmd_obj);
return; return;
...@@ -7686,11 +7686,11 @@ void survey_timer_hdl(struct adapter *padapter) ...@@ -7686,11 +7686,11 @@ void survey_timer_hdl(struct adapter *padapter)
pmlmeext->scan_abort = false;/* reset */ pmlmeext->scan_abort = false;/* reset */
} }
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (ph2c == NULL) if (ph2c == NULL)
goto exit_survey_timer_hdl; goto exit_survey_timer_hdl;
psurveyPara = (struct sitesurvey_parm *)rtw_zmalloc(sizeof(struct sitesurvey_parm)); psurveyPara = kzalloc(sizeof(struct sitesurvey_parm), GFP_KERNEL);
if (psurveyPara == NULL) { if (psurveyPara == NULL) {
kfree(ph2c); kfree(ph2c);
goto exit_survey_timer_hdl; goto exit_survey_timer_hdl;
...@@ -8268,13 +8268,13 @@ u8 set_tx_beacon_cmd(struct adapter *padapter) ...@@ -8268,13 +8268,13 @@ u8 set_tx_beacon_cmd(struct adapter *padapter)
int len_diff = 0; int len_diff = 0;
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (ph2c == NULL) { if (ph2c == NULL) {
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} }
ptxBeacon_parm = (struct Tx_Beacon_param *)rtw_zmalloc(sizeof(struct Tx_Beacon_param)); ptxBeacon_parm = kzalloc(sizeof(struct Tx_Beacon_param), GFP_KERNEL);
if (ptxBeacon_parm == NULL) { if (ptxBeacon_parm == NULL) {
kfree(ph2c); kfree(ph2c);
res = _FAIL; res = _FAIL;
......
...@@ -687,7 +687,7 @@ void SetPacketTx(struct adapter *padapter) ...@@ -687,7 +687,7 @@ void SetPacketTx(struct adapter *padapter)
kfree(pmp_priv->tx.pallocated_buf); kfree(pmp_priv->tx.pallocated_buf);
pmp_priv->tx.write_size = pkt_size; pmp_priv->tx.write_size = pkt_size;
pmp_priv->tx.buf_size = pkt_size + XMITBUF_ALIGN_SZ; pmp_priv->tx.buf_size = pkt_size + XMITBUF_ALIGN_SZ;
pmp_priv->tx.pallocated_buf = rtw_zmalloc(pmp_priv->tx.buf_size); pmp_priv->tx.pallocated_buf = kzalloc(pmp_priv->tx.buf_size, GFP_KERNEL);
if (pmp_priv->tx.pallocated_buf == NULL) { if (pmp_priv->tx.pallocated_buf == NULL) {
DBG_88E("%s: malloc(%d) fail!!\n", __func__, pmp_priv->tx.buf_size); DBG_88E("%s: malloc(%d) fail!!\n", __func__, pmp_priv->tx.buf_size);
return; return;
......
...@@ -50,7 +50,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) ...@@ -50,7 +50,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
DBG_88E("%s\n", __func__); DBG_88E("%s\n", __func__);
pdata_attr = rtw_zmalloc(MAX_P2P_IE_LEN); pdata_attr = kzalloc(MAX_P2P_IE_LEN, GFP_KERNEL);
pstart = pdata_attr; pstart = pdata_attr;
pcur = pdata_attr; pcur = pdata_attr;
...@@ -891,7 +891,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l ...@@ -891,7 +891,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
/* Check P2P Device Info ATTR */ /* Check P2P Device Info ATTR */
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO, NULL, (uint *)&attr_contentlen)) { if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO, NULL, (uint *)&attr_contentlen)) {
DBG_88E("[%s] Got P2P DEVICE INFO Attr!!\n", __func__); DBG_88E("[%s] Got P2P DEVICE INFO Attr!!\n", __func__);
pattr_content = rtw_zmalloc(attr_contentlen); pattr_content = kzalloc(attr_contentlen, GFP_KERNEL);
pbuf = pattr_content; pbuf = pattr_content;
if (pattr_content) { if (pattr_content) {
u8 num_of_secdev_type; u8 num_of_secdev_type;
...@@ -1738,13 +1738,13 @@ u8 p2p_ps_wk_cmd(struct adapter *padapter, u8 p2p_ps_state, u8 enqueue) ...@@ -1738,13 +1738,13 @@ u8 p2p_ps_wk_cmd(struct adapter *padapter, u8 p2p_ps_state, u8 enqueue)
return res; return res;
if (enqueue) { if (enqueue) {
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (ph2c == NULL) { if (ph2c == NULL) {
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} }
pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm)); pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_KERNEL);
if (pdrvextra_cmd_parm == NULL) { if (pdrvextra_cmd_parm == NULL) {
kfree(ph2c); kfree(ph2c);
res = _FAIL; res = _FAIL;
......
...@@ -935,7 +935,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) ...@@ -935,7 +935,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
return true; return true;
} }
bssid = (struct wlan_bssid_ex *)rtw_zmalloc(sizeof(struct wlan_bssid_ex)); bssid = kzalloc(sizeof(struct wlan_bssid_ex), GFP_KERNEL);
subtype = GetFrameSubType(pframe) >> 4; subtype = GetFrameSubType(pframe) >> 4;
......
...@@ -1637,7 +1637,7 @@ void rtw_alloc_hwxmits(struct adapter *padapter) ...@@ -1637,7 +1637,7 @@ void rtw_alloc_hwxmits(struct adapter *padapter)
pxmitpriv->hwxmit_entry = HWXMIT_ENTRY; pxmitpriv->hwxmit_entry = HWXMIT_ENTRY;
pxmitpriv->hwxmits = (struct hw_xmit *)rtw_zmalloc(sizeof(struct hw_xmit) * pxmitpriv->hwxmit_entry); pxmitpriv->hwxmits = kzalloc(sizeof(struct hw_xmit) * pxmitpriv->hwxmit_entry, GFP_KERNEL);
hwxmits = pxmitpriv->hwxmits; hwxmits = pxmitpriv->hwxmits;
......
...@@ -503,7 +503,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished) ...@@ -503,7 +503,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
struct rsvdpage_loc RsvdPageLoc; struct rsvdpage_loc RsvdPageLoc;
DBG_88E("%s\n", __func__); DBG_88E("%s\n", __func__);
ReservedPagePacket = (u8 *)rtw_zmalloc(1000); ReservedPagePacket = kzalloc(1000, GFP_KERNEL);
if (ReservedPagePacket == NULL) { if (ReservedPagePacket == NULL) {
DBG_88E("%s: alloc ReservedPagePacket fail!\n", __func__); DBG_88E("%s: alloc ReservedPagePacket fail!\n", __func__);
return; return;
......
...@@ -41,7 +41,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter) ...@@ -41,7 +41,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter)
/* init recv_buf */ /* init recv_buf */
_rtw_init_queue(&precvpriv->free_recv_buf_queue); _rtw_init_queue(&precvpriv->free_recv_buf_queue);
precvpriv->pallocated_recv_buf = rtw_zmalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4); precvpriv->pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_KERNEL);
if (precvpriv->pallocated_recv_buf == NULL) { if (precvpriv->pallocated_recv_buf == NULL) {
res = _FAIL; res = _FAIL;
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n")); RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n"));
......
...@@ -2211,7 +2211,7 @@ void rtl8188eu_set_hal_ops(struct adapter *adapt) ...@@ -2211,7 +2211,7 @@ void rtl8188eu_set_hal_ops(struct adapter *adapt)
struct hal_ops *halfunc = &adapt->HalFunc; struct hal_ops *halfunc = &adapt->HalFunc;
adapt->HalData = rtw_zmalloc(sizeof(struct hal_data_8188e)); adapt->HalData = kzalloc(sizeof(struct hal_data_8188e), GFP_KERNEL);
if (adapt->HalData == NULL) if (adapt->HalData == NULL)
DBG_88E("cant not alloc memory for HAL DATA\n"); DBG_88E("cant not alloc memory for HAL DATA\n");
......
...@@ -188,11 +188,9 @@ extern unsigned char WPA_TKIP_CIPHER[4]; ...@@ -188,11 +188,9 @@ extern unsigned char WPA_TKIP_CIPHER[4];
extern unsigned char RSN_TKIP_CIPHER[4]; extern unsigned char RSN_TKIP_CIPHER[4];
#define rtw_update_mem_stat(flag, sz) do {} while (0) #define rtw_update_mem_stat(flag, sz) do {} while (0)
u8 *_rtw_zmalloc(u32 sz);
u8 *_rtw_malloc(u32 sz); u8 *_rtw_malloc(u32 sz);
void _rtw_mfree(u8 *pbuf, u32 sz); void _rtw_mfree(u8 *pbuf, u32 sz);
#define rtw_malloc(sz) _rtw_malloc((sz)) #define rtw_malloc(sz) _rtw_malloc((sz))
#define rtw_zmalloc(sz) _rtw_zmalloc((sz))
#define rtw_mfree(pbuf, sz) _rtw_mfree((pbuf), (sz)) #define rtw_mfree(pbuf, sz) _rtw_mfree((pbuf), (sz))
void *rtw_malloc2d(int h, int w, int size); void *rtw_malloc2d(int h, int w, int size);
......
...@@ -632,7 +632,7 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie ...@@ -632,7 +632,7 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
} }
if (ielen) { if (ielen) {
buf = rtw_zmalloc(ielen); buf = kzalloc(ielen, GFP_KERNEL);
if (buf == NULL) { if (buf == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto exit; goto exit;
...@@ -4721,13 +4721,13 @@ static u8 set_pairwise_key(struct adapter *padapter, struct sta_info *psta) ...@@ -4721,13 +4721,13 @@ static u8 set_pairwise_key(struct adapter *padapter, struct sta_info *psta)
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS; u8 res = _SUCCESS;
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (ph2c == NULL) { if (ph2c == NULL) {
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} }
psetstakey_para = (struct set_stakey_parm *)rtw_zmalloc(sizeof(struct set_stakey_parm)); psetstakey_para = kzalloc(sizeof(struct set_stakey_parm), GFP_KERNEL);
if (psetstakey_para == NULL) { if (psetstakey_para == NULL) {
kfree(ph2c); kfree(ph2c);
res = _FAIL; res = _FAIL;
...@@ -4759,12 +4759,12 @@ static int set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid) ...@@ -4759,12 +4759,12 @@ static int set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid)
DBG_88E("%s\n", __func__); DBG_88E("%s\n", __func__);
pcmd = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); pcmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
if (pcmd == NULL) { if (pcmd == NULL) {
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} }
psetkeyparm = (struct setkey_parm *)rtw_zmalloc(sizeof(struct setkey_parm)); psetkeyparm = kzalloc(sizeof(struct setkey_parm), GFP_KERNEL);
if (psetkeyparm == NULL) { if (psetkeyparm == NULL) {
kfree(pcmd); kfree(pcmd);
res = _FAIL; res = _FAIL;
...@@ -5672,12 +5672,12 @@ static int rtw_mp_efuse_get(struct net_device *dev, ...@@ -5672,12 +5672,12 @@ static int rtw_mp_efuse_get(struct net_device *dev,
pEfuseHal = &haldata->EfuseHal; pEfuseHal = &haldata->EfuseHal;
err = 0; err = 0;
data = _rtw_zmalloc(EFUSE_BT_MAX_MAP_LEN); data = kzalloc(EFUSE_BT_MAX_MAP_LEN, GFP_KERNEL);
if (data == NULL) { if (data == NULL) {
err = -ENOMEM; err = -ENOMEM;
goto exit; goto exit;
} }
rawdata = _rtw_zmalloc(EFUSE_BT_MAX_MAP_LEN); rawdata = kzalloc(EFUSE_BT_MAX_MAP_LEN, GFP_KERNEL);
if (rawdata == NULL) { if (rawdata == NULL) {
err = -ENOMEM; err = -ENOMEM;
goto exit; goto exit;
...@@ -5916,7 +5916,7 @@ static int rtw_mp_efuse_set(struct net_device *dev, ...@@ -5916,7 +5916,7 @@ static int rtw_mp_efuse_set(struct net_device *dev,
haldata = GET_HAL_DATA(padapter); haldata = GET_HAL_DATA(padapter);
pEfuseHal = &haldata->EfuseHal; pEfuseHal = &haldata->EfuseHal;
err = 0; err = 0;
setdata = _rtw_zmalloc(1024); setdata = kzalloc(1024, GFP_KERNEL);
if (setdata == NULL) { if (setdata == NULL) {
err = -ENOMEM; err = -ENOMEM;
goto exit; goto exit;
...@@ -7438,7 +7438,7 @@ static int rtw_test( ...@@ -7438,7 +7438,7 @@ static int rtw_test(
DBG_88E("+%s\n", __func__); DBG_88E("+%s\n", __func__);
len = wrqu->data.length; len = wrqu->data.length;
pbuf = (u8 *)rtw_zmalloc(len); pbuf = kzalloc(len, GFP_KERNEL);
if (pbuf == NULL) { if (pbuf == NULL) {
DBG_88E("%s: no memory!\n", __func__); DBG_88E("%s: no memory!\n", __func__);
return -ENOMEM; return -ENOMEM;
...@@ -7783,7 +7783,7 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_ ...@@ -7783,7 +7783,7 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_
memcpy(&wdata, wrq_data, sizeof(wdata)); memcpy(&wdata, wrq_data, sizeof(wdata));
input_len = wdata.data.length; input_len = wdata.data.length;
input = rtw_zmalloc(input_len); input = kzalloc(input_len, GFP_KERNEL);
if (NULL == input) if (NULL == input)
return -ENOMEM; return -ENOMEM;
if (copy_from_user(input, wdata.data.pointer, input_len)) { if (copy_from_user(input, wdata.data.pointer, input_len)) {
...@@ -7850,7 +7850,7 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_ ...@@ -7850,7 +7850,7 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_
k = j; k = j;
} }
buffer = rtw_zmalloc(4096); buffer = kzalloc(4096, GFP_KERNEL);
if (NULL == buffer) { if (NULL == buffer) {
err = -ENOMEM; err = -ENOMEM;
goto exit; goto exit;
...@@ -7999,7 +7999,7 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_ ...@@ -7999,7 +7999,7 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_
else else
n = wdata.data.length; n = wdata.data.length;
output = rtw_zmalloc(4096); output = kzalloc(4096, GFP_KERNEL);
if (NULL == output) { if (NULL == output) {
err = -ENOMEM; err = -ENOMEM;
goto exit; goto exit;
......
...@@ -47,20 +47,11 @@ u8 *_rtw_malloc(u32 sz) ...@@ -47,20 +47,11 @@ u8 *_rtw_malloc(u32 sz)
return pbuf; return pbuf;
} }
u8 *_rtw_zmalloc(u32 sz)
{
u8 *pbuf = _rtw_malloc(sz);
if (pbuf != NULL)
memset(pbuf, 0, sz);
return pbuf;
}
void *rtw_malloc2d(int h, int w, int size) void *rtw_malloc2d(int h, int w, int size)
{ {
int j; int j;
void **a = (void **)rtw_zmalloc(h*sizeof(void *) + h*w*size); void **a = (void **)kzalloc(h*sizeof(void *) + h*w*size, GFP_KERNEL);
if (a == NULL) { if (a == NULL) {
pr_info("%s: alloc memory fail!\n", __func__); pr_info("%s: alloc memory fail!\n", __func__);
return NULL; return NULL;
......
...@@ -66,7 +66,7 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf) ...@@ -66,7 +66,7 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
struct usb_device *pusbd; struct usb_device *pusbd;
pdvobjpriv = (struct dvobj_priv *)rtw_zmalloc(sizeof(*pdvobjpriv)); pdvobjpriv = kzalloc(sizeof(*pdvobjpriv), GFP_KERNEL);
if (pdvobjpriv == NULL) if (pdvobjpriv == NULL)
goto exit; goto exit;
...@@ -116,7 +116,7 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf) ...@@ -116,7 +116,7 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
pdvobjpriv->ishighspeed = false; pdvobjpriv->ishighspeed = false;
mutex_init(&pdvobjpriv->usb_vendor_req_mutex); mutex_init(&pdvobjpriv->usb_vendor_req_mutex);
pdvobjpriv->usb_vendor_req_buf = rtw_zmalloc(MAX_USB_IO_CTL_SIZE); pdvobjpriv->usb_vendor_req_buf = kzalloc(MAX_USB_IO_CTL_SIZE, GFP_KERNEL);
if (!pdvobjpriv->usb_vendor_req_buf) if (!pdvobjpriv->usb_vendor_req_buf)
goto free_dvobj; goto free_dvobj;
......
...@@ -80,7 +80,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb ...@@ -80,7 +80,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
{ {
int i; int i;
pxmitbuf->pallocated_buf = rtw_zmalloc(alloc_sz); pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL);
if (pxmitbuf->pallocated_buf == NULL) if (pxmitbuf->pallocated_buf == NULL)
return _FAIL; return _FAIL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment