Skip to contentSkip to conversation

staging: rtl8723bs: os_dep: Make use rtw_zmalloc

PATCH In review Hariprasad Kelam 2 participants 2 messages Jun 16, 2019 – Jun 18, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: os_dep: Make use rtw_zmalloc

rtw_malloc with memset can be replaced with rtw_zmalloc.

---
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +1 -3
index 9bc6856..aa7cc50 100644
@@ -1078,12 +1078,10 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
 	DBG_871X("pairwise =%d\n", pairwise);
 
 	param_len = sizeof(struct ieee_param) + params->key_len;
-	param = rtw_malloc(param_len);
+	param = rtw_zmalloc(param_len);
 	if (param == NULL)
 		return -1;
 
-	memset(param, 0, param_len);
-
 	param->cmd = IEEE_CMD_SET_ENCRYPTION;
 	memset(param->sta_addr, 0xff, ETH_ALEN);
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 12 lines · Hariprasad Kelam

rtw_malloc with memset can be replaced with rtw_zmalloc.

---
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +0 -0
index 9bc6856..aa7cc50 100644

drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, · line 1081

Quoted 5 lines
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +1 -1
@@ -1078,12 +1078,10 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
 	DBG_871X("pairwise =%d\n", pairwise);
 
 	param_len = sizeof(struct ieee_param) + params->key_len;
-	param = rtw_malloc(param_len);
+	param = rtw_zmalloc(param_len);

No, please call the "real" kernel function instead.

thanks,

greg k-h