summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/sta_ioctl.c
diff options
context:
space:
mode:
authorYogesh Ashok Powar <yogeshp@marvell.com>2011-08-29 13:21:10 -0700
committerJohn W. Linville <linville@tuxdriver.com>2011-09-13 15:42:32 -0400
commit5982b47aa410e6aef55a5b0087269f5c9c172110 (patch)
treed23936da1e56446d80cc626d50311e4e7ba53efc /drivers/net/wireless/mwifiex/sta_ioctl.c
parent3459731a39894e5377283b3ccf2fede54e19aae1 (diff)
downloadblackbird-op-linux-5982b47aa410e6aef55a5b0087269f5c9c172110.tar.gz
blackbird-op-linux-5982b47aa410e6aef55a5b0087269f5c9c172110.zip
mwifiex: replace kmalloc & memcpy sequence with kmemdup
Sequence of kmalloc/kzalloc and memcpy is replaced with kmemdup. Cc: Walter Harms <wharms@bfs.de> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/sta_ioctl.c')
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 3fca219bcfb6..eb569fa9adba 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -199,13 +199,14 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
dev_err(priv->adapter->dev, " failed to alloc bss_desc\n");
return -ENOMEM;
}
- beacon_ie = kzalloc(bss->len_beacon_ies, GFP_KERNEL);
+
+ beacon_ie = kmemdup(bss->information_elements,
+ bss->len_beacon_ies, GFP_KERNEL);
if (!beacon_ie) {
- dev_err(priv->adapter->dev, " failed to alloc bss_desc\n");
+ dev_err(priv->adapter->dev, " failed to alloc beacon_ie\n");
return -ENOMEM;
}
- memcpy(beacon_ie, bss->information_elements,
- bss->len_beacon_ies);
+
ret = mwifiex_fill_new_bss_desc(priv, bss->bssid, bss->signal,
beacon_ie, bss->len_beacon_ies,
bss->beacon_interval,
OpenPOWER on IntegriCloud