Skip to content

Commit fadbe0c

Browse files
navin-patidargregkh
authored andcommitted
staging: rtl8188eu:Remove rtw_zmalloc(), wrapper for kzalloc()
Signed-off-by: navin patidar <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a733e46 commit fadbe0c

16 files changed

+108
-119
lines changed

drivers/staging/rtl8188eu/core/rtw_cmd.c

Lines changed: 62 additions & 62 deletions
Large diffs are not rendered by default.

drivers/staging/rtl8188eu/core/rtw_efuse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf)
103103
u16 efuse_utilized = 0;
104104
u8 u1temp = 0;
105105

106-
efuseTbl = (u8 *)rtw_zmalloc(EFUSE_MAP_LEN_88E);
106+
efuseTbl = kzalloc(EFUSE_MAP_LEN_88E, GFP_KERNEL);
107107
if (efuseTbl == NULL) {
108108
DBG_88E("%s: alloc efuseTbl fail!\n", __func__);
109109
goto exit;
@@ -1083,7 +1083,7 @@ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data)
10831083
if ((addr + cnts) > mapLen)
10841084
return _FAIL;
10851085

1086-
map = rtw_zmalloc(mapLen);
1086+
map = kzalloc(mapLen, GFP_KERNEL);
10871087
if (map == NULL)
10881088
return _FAIL;
10891089

drivers/staging/rtl8188eu/core/rtw_mlme.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,13 +1666,13 @@ int rtw_set_auth(struct adapter *adapter, struct security_priv *psecuritypriv)
16661666
struct cmd_priv *pcmdpriv = &(adapter->cmdpriv);
16671667
int res = _SUCCESS;
16681668

1669-
pcmd = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
1669+
pcmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
16701670
if (pcmd == NULL) {
16711671
res = _FAIL; /* try again */
16721672
goto exit;
16731673
}
16741674

1675-
psetauthparm = (struct setauth_parm *)rtw_zmalloc(sizeof(struct setauth_parm));
1675+
psetauthparm = kzalloc(sizeof(struct setauth_parm), GFP_KERNEL);
16761676
if (psetauthparm == NULL) {
16771677
kfree(pcmd);
16781678
res = _FAIL;
@@ -1703,11 +1703,11 @@ int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, in
17031703
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
17041704
int res = _SUCCESS;
17051705

1706-
pcmd = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
1706+
pcmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
17071707
if (pcmd == NULL)
17081708
return _FAIL; /* try again */
17091709

1710-
psetkeyparm = (struct setkey_parm *)rtw_zmalloc(sizeof(struct setkey_parm));
1710+
psetkeyparm = kzalloc(sizeof(struct setkey_parm), GFP_KERNEL);
17111711
if (psetkeyparm == NULL) {
17121712
res = _FAIL;
17131713
goto err_free_cmd;

drivers/staging/rtl8188eu/core/rtw_mlme_ext.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7055,12 +7055,12 @@ void report_survey_event(struct adapter *padapter,
70557055
pcmdpriv = &padapter->cmdpriv;
70567056

70577057

7058-
pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
7058+
pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
70597059
if (pcmd_obj == NULL)
70607060
return;
70617061

70627062
cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header));
7063-
pevtcmd = (u8 *)rtw_zmalloc(cmdsz);
7063+
pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
70647064
if (pevtcmd == NULL) {
70657065
kfree(pcmd_obj);
70667066
return;
@@ -7107,12 +7107,12 @@ void report_surveydone_event(struct adapter *padapter)
71077107
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
71087108
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
71097109

7110-
pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
7110+
pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
71117111
if (pcmd_obj == NULL)
71127112
return;
71137113

71147114
cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header));
7115-
pevtcmd = (u8 *)rtw_zmalloc(cmdsz);
7115+
pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
71167116
if (pevtcmd == NULL) {
71177117
kfree(pcmd_obj);
71187118
return;
@@ -7153,12 +7153,12 @@ void report_join_res(struct adapter *padapter, int res)
71537153
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
71547154
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
71557155

7156-
pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
7156+
pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
71577157
if (pcmd_obj == NULL)
71587158
return;
71597159

71607160
cmdsz = (sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header));
7161-
pevtcmd = (u8 *)rtw_zmalloc(cmdsz);
7161+
pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
71627162
if (pevtcmd == NULL) {
71637163
kfree(pcmd_obj);
71647164
return;
@@ -7206,12 +7206,12 @@ void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, unsi
72067206
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
72077207
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
72087208

7209-
pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
7209+
pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
72107210
if (pcmd_obj == NULL)
72117211
return;
72127212

72137213
cmdsz = (sizeof(struct stadel_event) + sizeof(struct C2HEvent_Header));
7214-
pevtcmd = (u8 *)rtw_zmalloc(cmdsz);
7214+
pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
72157215
if (pevtcmd == NULL) {
72167216
kfree(pcmd_obj);
72177217
return;
@@ -7261,12 +7261,12 @@ void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, int
72617261
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
72627262
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
72637263

7264-
pcmd_obj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
7264+
pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
72657265
if (pcmd_obj == NULL)
72667266
return;
72677267

72687268
cmdsz = (sizeof(struct stassoc_event) + sizeof(struct C2HEvent_Header));
7269-
pevtcmd = (u8 *)rtw_zmalloc(cmdsz);
7269+
pevtcmd = kzalloc(cmdsz, GFP_KERNEL);
72707270
if (pevtcmd == NULL) {
72717271
kfree(pcmd_obj);
72727272
return;
@@ -7686,11 +7686,11 @@ void survey_timer_hdl(struct adapter *padapter)
76867686
pmlmeext->scan_abort = false;/* reset */
76877687
}
76887688

7689-
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
7689+
ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
76907690
if (ph2c == NULL)
76917691
goto exit_survey_timer_hdl;
76927692

7693-
psurveyPara = (struct sitesurvey_parm *)rtw_zmalloc(sizeof(struct sitesurvey_parm));
7693+
psurveyPara = kzalloc(sizeof(struct sitesurvey_parm), GFP_KERNEL);
76947694
if (psurveyPara == NULL) {
76957695
kfree(ph2c);
76967696
goto exit_survey_timer_hdl;
@@ -8268,13 +8268,13 @@ u8 set_tx_beacon_cmd(struct adapter *padapter)
82688268
int len_diff = 0;
82698269

82708270

8271-
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
8271+
ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
82728272
if (ph2c == NULL) {
82738273
res = _FAIL;
82748274
goto exit;
82758275
}
82768276

8277-
ptxBeacon_parm = (struct Tx_Beacon_param *)rtw_zmalloc(sizeof(struct Tx_Beacon_param));
8277+
ptxBeacon_parm = kzalloc(sizeof(struct Tx_Beacon_param), GFP_KERNEL);
82788278
if (ptxBeacon_parm == NULL) {
82798279
kfree(ph2c);
82808280
res = _FAIL;

drivers/staging/rtl8188eu/core/rtw_mp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ void SetPacketTx(struct adapter *padapter)
687687
kfree(pmp_priv->tx.pallocated_buf);
688688
pmp_priv->tx.write_size = pkt_size;
689689
pmp_priv->tx.buf_size = pkt_size + XMITBUF_ALIGN_SZ;
690-
pmp_priv->tx.pallocated_buf = rtw_zmalloc(pmp_priv->tx.buf_size);
690+
pmp_priv->tx.pallocated_buf = kzalloc(pmp_priv->tx.buf_size, GFP_KERNEL);
691691
if (pmp_priv->tx.pallocated_buf == NULL) {
692692
DBG_88E("%s: malloc(%d) fail!!\n", __func__, pmp_priv->tx.buf_size);
693693
return;

drivers/staging/rtl8188eu/core/rtw_p2p.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
5050

5151
DBG_88E("%s\n", __func__);
5252

53-
pdata_attr = rtw_zmalloc(MAX_P2P_IE_LEN);
53+
pdata_attr = kzalloc(MAX_P2P_IE_LEN, GFP_KERNEL);
5454

5555
pstart = pdata_attr;
5656
pcur = pdata_attr;
@@ -891,7 +891,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
891891
/* Check P2P Device Info ATTR */
892892
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO, NULL, (uint *)&attr_contentlen)) {
893893
DBG_88E("[%s] Got P2P DEVICE INFO Attr!!\n", __func__);
894-
pattr_content = rtw_zmalloc(attr_contentlen);
894+
pattr_content = kzalloc(attr_contentlen, GFP_KERNEL);
895895
pbuf = pattr_content;
896896
if (pattr_content) {
897897
u8 num_of_secdev_type;
@@ -1738,13 +1738,13 @@ u8 p2p_ps_wk_cmd(struct adapter *padapter, u8 p2p_ps_state, u8 enqueue)
17381738
return res;
17391739

17401740
if (enqueue) {
1741-
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
1741+
ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
17421742
if (ph2c == NULL) {
17431743
res = _FAIL;
17441744
goto exit;
17451745
}
17461746

1747-
pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
1747+
pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_KERNEL);
17481748
if (pdrvextra_cmd_parm == NULL) {
17491749
kfree(ph2c);
17501750
res = _FAIL;

drivers/staging/rtl8188eu/core/rtw_wlan_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
935935
return true;
936936
}
937937

938-
bssid = (struct wlan_bssid_ex *)rtw_zmalloc(sizeof(struct wlan_bssid_ex));
938+
bssid = kzalloc(sizeof(struct wlan_bssid_ex), GFP_KERNEL);
939939

940940
subtype = GetFrameSubType(pframe) >> 4;
941941

drivers/staging/rtl8188eu/core/rtw_xmit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ void rtw_alloc_hwxmits(struct adapter *padapter)
16371637

16381638
pxmitpriv->hwxmit_entry = HWXMIT_ENTRY;
16391639

1640-
pxmitpriv->hwxmits = (struct hw_xmit *)rtw_zmalloc(sizeof(struct hw_xmit) * pxmitpriv->hwxmit_entry);
1640+
pxmitpriv->hwxmits = kzalloc(sizeof(struct hw_xmit) * pxmitpriv->hwxmit_entry, GFP_KERNEL);
16411641

16421642
hwxmits = pxmitpriv->hwxmits;
16431643

drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
503503
struct rsvdpage_loc RsvdPageLoc;
504504

505505
DBG_88E("%s\n", __func__);
506-
ReservedPagePacket = (u8 *)rtw_zmalloc(1000);
506+
ReservedPagePacket = kzalloc(1000, GFP_KERNEL);
507507
if (ReservedPagePacket == NULL) {
508508
DBG_88E("%s: alloc ReservedPagePacket fail!\n", __func__);
509509
return;

drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter)
4141
/* init recv_buf */
4242
_rtw_init_queue(&precvpriv->free_recv_buf_queue);
4343

44-
precvpriv->pallocated_recv_buf = rtw_zmalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4);
44+
precvpriv->pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_KERNEL);
4545
if (precvpriv->pallocated_recv_buf == NULL) {
4646
res = _FAIL;
4747
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n"));

drivers/staging/rtl8188eu/hal/usb_halinit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2211,7 +2211,7 @@ void rtl8188eu_set_hal_ops(struct adapter *adapt)
22112211
struct hal_ops *halfunc = &adapt->HalFunc;
22122212

22132213

2214-
adapt->HalData = rtw_zmalloc(sizeof(struct hal_data_8188e));
2214+
adapt->HalData = kzalloc(sizeof(struct hal_data_8188e), GFP_KERNEL);
22152215
if (adapt->HalData == NULL)
22162216
DBG_88E("cant not alloc memory for HAL DATA\n");
22172217

drivers/staging/rtl8188eu/include/osdep_service.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,9 @@ extern unsigned char WPA_TKIP_CIPHER[4];
188188
extern unsigned char RSN_TKIP_CIPHER[4];
189189

190190
#define rtw_update_mem_stat(flag, sz) do {} while (0)
191-
u8 *_rtw_zmalloc(u32 sz);
192191
u8 *_rtw_malloc(u32 sz);
193192
void _rtw_mfree(u8 *pbuf, u32 sz);
194193
#define rtw_malloc(sz) _rtw_malloc((sz))
195-
#define rtw_zmalloc(sz) _rtw_zmalloc((sz))
196194
#define rtw_mfree(pbuf, sz) _rtw_mfree((pbuf), (sz))
197195

198196
void *rtw_malloc2d(int h, int w, int size);

drivers/staging/rtl8188eu/os_dep/ioctl_linux.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
632632
}
633633

634634
if (ielen) {
635-
buf = rtw_zmalloc(ielen);
635+
buf = kzalloc(ielen, GFP_KERNEL);
636636
if (buf == NULL) {
637637
ret = -ENOMEM;
638638
goto exit;
@@ -4721,13 +4721,13 @@ static u8 set_pairwise_key(struct adapter *padapter, struct sta_info *psta)
47214721
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
47224722
u8 res = _SUCCESS;
47234723

4724-
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
4724+
ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
47254725
if (ph2c == NULL) {
47264726
res = _FAIL;
47274727
goto exit;
47284728
}
47294729

4730-
psetstakey_para = (struct set_stakey_parm *)rtw_zmalloc(sizeof(struct set_stakey_parm));
4730+
psetstakey_para = kzalloc(sizeof(struct set_stakey_parm), GFP_KERNEL);
47314731
if (psetstakey_para == NULL) {
47324732
kfree(ph2c);
47334733
res = _FAIL;
@@ -4759,12 +4759,12 @@ static int set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid)
47594759

47604760
DBG_88E("%s\n", __func__);
47614761

4762-
pcmd = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
4762+
pcmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
47634763
if (pcmd == NULL) {
47644764
res = _FAIL;
47654765
goto exit;
47664766
}
4767-
psetkeyparm = (struct setkey_parm *)rtw_zmalloc(sizeof(struct setkey_parm));
4767+
psetkeyparm = kzalloc(sizeof(struct setkey_parm), GFP_KERNEL);
47684768
if (psetkeyparm == NULL) {
47694769
kfree(pcmd);
47704770
res = _FAIL;
@@ -5672,12 +5672,12 @@ static int rtw_mp_efuse_get(struct net_device *dev,
56725672
pEfuseHal = &haldata->EfuseHal;
56735673

56745674
err = 0;
5675-
data = _rtw_zmalloc(EFUSE_BT_MAX_MAP_LEN);
5675+
data = kzalloc(EFUSE_BT_MAX_MAP_LEN, GFP_KERNEL);
56765676
if (data == NULL) {
56775677
err = -ENOMEM;
56785678
goto exit;
56795679
}
5680-
rawdata = _rtw_zmalloc(EFUSE_BT_MAX_MAP_LEN);
5680+
rawdata = kzalloc(EFUSE_BT_MAX_MAP_LEN, GFP_KERNEL);
56815681
if (rawdata == NULL) {
56825682
err = -ENOMEM;
56835683
goto exit;
@@ -5916,7 +5916,7 @@ static int rtw_mp_efuse_set(struct net_device *dev,
59165916
haldata = GET_HAL_DATA(padapter);
59175917
pEfuseHal = &haldata->EfuseHal;
59185918
err = 0;
5919-
setdata = _rtw_zmalloc(1024);
5919+
setdata = kzalloc(1024, GFP_KERNEL);
59205920
if (setdata == NULL) {
59215921
err = -ENOMEM;
59225922
goto exit;
@@ -7438,7 +7438,7 @@ static int rtw_test(
74387438
DBG_88E("+%s\n", __func__);
74397439
len = wrqu->data.length;
74407440

7441-
pbuf = (u8 *)rtw_zmalloc(len);
7441+
pbuf = kzalloc(len, GFP_KERNEL);
74427442
if (pbuf == NULL) {
74437443
DBG_88E("%s: no memory!\n", __func__);
74447444
return -ENOMEM;
@@ -7783,7 +7783,7 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_
77837783
memcpy(&wdata, wrq_data, sizeof(wdata));
77847784

77857785
input_len = wdata.data.length;
7786-
input = rtw_zmalloc(input_len);
7786+
input = kzalloc(input_len, GFP_KERNEL);
77877787
if (NULL == input)
77887788
return -ENOMEM;
77897789
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_
78507850
k = j;
78517851
}
78527852

7853-
buffer = rtw_zmalloc(4096);
7853+
buffer = kzalloc(4096, GFP_KERNEL);
78547854
if (NULL == buffer) {
78557855
err = -ENOMEM;
78567856
goto exit;
@@ -7999,7 +7999,7 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_
79997999
else
80008000
n = wdata.data.length;
80018001

8002-
output = rtw_zmalloc(4096);
8002+
output = kzalloc(4096, GFP_KERNEL);
80038003
if (NULL == output) {
80048004
err = -ENOMEM;
80058005
goto exit;

drivers/staging/rtl8188eu/os_dep/osdep_service.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,11 @@ u8 *_rtw_malloc(u32 sz)
4747
return pbuf;
4848
}
4949

50-
u8 *_rtw_zmalloc(u32 sz)
51-
{
52-
u8 *pbuf = _rtw_malloc(sz);
53-
54-
if (pbuf != NULL)
55-
memset(pbuf, 0, sz);
56-
return pbuf;
57-
}
58-
5950
void *rtw_malloc2d(int h, int w, int size)
6051
{
6152
int j;
6253

63-
void **a = (void **)rtw_zmalloc(h*sizeof(void *) + h*w*size);
54+
void **a = (void **)kzalloc(h*sizeof(void *) + h*w*size, GFP_KERNEL);
6455
if (a == NULL) {
6556
pr_info("%s: alloc memory fail!\n", __func__);
6657
return NULL;

drivers/staging/rtl8188eu/os_dep/usb_intf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
6666
struct usb_device *pusbd;
6767

6868

69-
pdvobjpriv = (struct dvobj_priv *)rtw_zmalloc(sizeof(*pdvobjpriv));
69+
pdvobjpriv = kzalloc(sizeof(*pdvobjpriv), GFP_KERNEL);
7070
if (pdvobjpriv == NULL)
7171
goto exit;
7272

@@ -116,7 +116,7 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
116116
pdvobjpriv->ishighspeed = false;
117117

118118
mutex_init(&pdvobjpriv->usb_vendor_req_mutex);
119-
pdvobjpriv->usb_vendor_req_buf = rtw_zmalloc(MAX_USB_IO_CTL_SIZE);
119+
pdvobjpriv->usb_vendor_req_buf = kzalloc(MAX_USB_IO_CTL_SIZE, GFP_KERNEL);
120120

121121
if (!pdvobjpriv->usb_vendor_req_buf)
122122
goto free_dvobj;

0 commit comments

Comments
 (0)