diff options
author | Yogesh Ashok Powar <yogeshp@marvell.com> | 2011-08-29 16:21:10 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-13 15:42:32 -0400 |
commit | 5982b47aa410e6aef55a5b0087269f5c9c172110 (patch) | |
tree | d23936da1e56446d80cc626d50311e4e7ba53efc /drivers/net/wireless/mwifiex/scan.c | |
parent | 3459731a39894e5377283b3ccf2fede54e19aae1 (diff) |
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/scan.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/scan.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 37ca2f90ad63..8d8588db1cd9 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c | |||
@@ -1479,12 +1479,12 @@ mwifiex_update_curr_bss_params(struct mwifiex_private *priv, | |||
1479 | dev_err(priv->adapter->dev, " failed to alloc bss_desc\n"); | 1479 | dev_err(priv->adapter->dev, " failed to alloc bss_desc\n"); |
1480 | return -ENOMEM; | 1480 | return -ENOMEM; |
1481 | } | 1481 | } |
1482 | beacon_ie = kzalloc(ie_len, GFP_KERNEL); | 1482 | |
1483 | beacon_ie = kmemdup(ie_buf, ie_len, GFP_KERNEL); | ||
1483 | if (!beacon_ie) { | 1484 | if (!beacon_ie) { |
1484 | dev_err(priv->adapter->dev, " failed to alloc beacon_ie\n"); | 1485 | dev_err(priv->adapter->dev, " failed to alloc beacon_ie\n"); |
1485 | return -ENOMEM; | 1486 | return -ENOMEM; |
1486 | } | 1487 | } |
1487 | memcpy(beacon_ie, ie_buf, ie_len); | ||
1488 | 1488 | ||
1489 | ret = mwifiex_fill_new_bss_desc(priv, bssid, rssi, beacon_ie, | 1489 | ret = mwifiex_fill_new_bss_desc(priv, bssid, rssi, beacon_ie, |
1490 | ie_len, beacon_period, | 1490 | ie_len, beacon_period, |
@@ -1986,7 +1986,7 @@ mwifiex_save_curr_bcn(struct mwifiex_private *priv) | |||
1986 | priv->curr_bcn_size = curr_bss->beacon_buf_size; | 1986 | priv->curr_bcn_size = curr_bss->beacon_buf_size; |
1987 | 1987 | ||
1988 | kfree(priv->curr_bcn_buf); | 1988 | kfree(priv->curr_bcn_buf); |
1989 | priv->curr_bcn_buf = kzalloc(curr_bss->beacon_buf_size, | 1989 | priv->curr_bcn_buf = kmalloc(curr_bss->beacon_buf_size, |
1990 | GFP_KERNEL); | 1990 | GFP_KERNEL); |
1991 | if (!priv->curr_bcn_buf) { | 1991 | if (!priv->curr_bcn_buf) { |
1992 | dev_err(priv->adapter->dev, | 1992 | dev_err(priv->adapter->dev, |