mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dhere, Chaitanya (C.)" <cvijaydh@visteon.com>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"navin.patidar@gmail.com" <navin.patidar@gmail.com>,
	"dan.carpenter@oracle.com" <dan.carpenter@oracle.com>,
	"vthakkar1994@gmail.com" <vthakkar1994@gmail.com>,
	"tapaswenipathak@gmail.com" <tapaswenipathak@gmail.com>,
	"abelmoyo.ab@gmail.com" <abelmoyo.ab@gmail.com>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] Staging: rtl8188eu: Replaced kzalloc and memcpy combination with kmemdup
Date: Tue, 7 Apr 2015 14:25:39 +0000	[thread overview]
Message-ID: <20150407142449.GA3000@chaitanya-Ideapad-Z560> (raw)

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

             reply	other threads:[~2015-04-07 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07 14:25 Dhere, Chaitanya (C.) [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150407142449.GA3000@chaitanya-Ideapad-Z560 \
    --to=cvijaydh@visteon.com \
    --cc=abelmoyo.ab@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=navin.patidar@gmail.com \
    --cc=tapaswenipathak@gmail.com \
    --cc=vthakkar1994@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®