public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8188eu: Replaced kzalloc and memcpy combination with kmemdup
@ 2015-04-07 14:25 Dhere, Chaitanya (C.)
  2015-04-08  4:14 ` Sudip Mukherjee
  0 siblings, 1 reply; 4+ messages in thread
From: Dhere, Chaitanya (C.) @ 2015-04-07 14:25 UTC (permalink / raw)
  To: gregkh@linuxfoundation.org, navin.patidar@gmail.com,
	dan.carpenter@oracle.com, vthakkar1994@gmail.com,
	tapaswenipathak@gmail.com, abelmoyo.ab@gmail.com
  Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org

This change was detected with the help of coccinelle tool.
It performs the same function as kzalloc amd memcpy.

Signed-off-by: Chaitanya Dhere <cvijaydh@visteon.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 86d955f..07ae6cf 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -5431,15 +5431,14 @@ u8 set_tx_beacon_cmd(struct adapter *padapter)
 		goto exit;
 	}
 
-	ptxBeacon_parm = kzalloc(sizeof(struct wlan_bssid_ex), GFP_KERNEL);
+	ptxBeacon_parm = kmemdup(&(pmlmeinfo->network),
+				 sizeof(struct wlan_bssid_ex), GFP_KERNEL);
 	if (ptxBeacon_parm == NULL) {
 		kfree(ph2c);
 		res = _FAIL;
 		goto exit;
 	}
 
-	memcpy(ptxBeacon_parm, &(pmlmeinfo->network), sizeof(struct wlan_bssid_ex));
-
 	len_diff = update_hidden_ssid(ptxBeacon_parm->IEs+_BEACON_IE_OFFSET_,
 				      ptxBeacon_parm->IELength-_BEACON_IE_OFFSET_,
 				      pmlmeinfo->hidden_ssid_mode);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] Staging: rtl8188eu: Replaced kzalloc and memcpy combination with kmemdup
@ 2015-03-30 15:11 Dhere, Chaitanya (C.)
  2015-04-03 13:40 ` gregkh
  0 siblings, 1 reply; 4+ messages in thread
From: Dhere, Chaitanya (C.) @ 2015-03-30 15:11 UTC (permalink / raw)
  To: gregkh@linuxfoundation.org, navin.patidar@gmail.com,
	vthakkar1994@gmail.com, tapaswenipathak@gmail.com,
	dan.carpenter@oracle.com, abelmoyo.ab@gmail.com
  Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org

This change was detected with the help of coccinelle tool.
It performs the same function as kzalloc amd memcpy.

Signed-off-by: Chaitanya Dhere <cvijaydh@visteon.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 86d955f..07ae6cf 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -5431,15 +5431,14 @@ u8 set_tx_beacon_cmd(struct adapter *padapter)
 		goto exit;
 	}
 
-	ptxBeacon_parm = kzalloc(sizeof(struct wlan_bssid_ex), GFP_KERNEL);
+	ptxBeacon_parm = kmemdup(&(pmlmeinfo->network),
+				 sizeof(struct wlan_bssid_ex), GFP_KERNEL);
 	if (ptxBeacon_parm == NULL) {
 		kfree(ph2c);
 		res = _FAIL;
 		goto exit;
 	}
 
-	memcpy(ptxBeacon_parm, &(pmlmeinfo->network), sizeof(struct wlan_bssid_ex));
-
 	len_diff = update_hidden_ssid(ptxBeacon_parm->IEs+_BEACON_IE_OFFSET_,
 				      ptxBeacon_parm->IELength-_BEACON_IE_OFFSET_,
 				      pmlmeinfo->hidden_ssid_mode);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-08  4:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-07 14:25 [PATCH] Staging: rtl8188eu: Replaced kzalloc and memcpy combination with kmemdup Dhere, Chaitanya (C.)
2015-04-08  4:14 ` Sudip Mukherjee
  -- strict thread matches above, loose matches on Subject: below --
2015-03-30 15:11 Dhere, Chaitanya (C.)
2015-04-03 13:40 ` gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox