diff options
author | Yogesh Ashok Powar <yogeshp@marvell.com> | 2011-08-29 13:21:10 -0700 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-13 15:42:32 -0400 |
commit | 5982b47aa410e6aef55a5b0087269f5c9c172110 (patch) | |
tree | d23936da1e56446d80cc626d50311e4e7ba53efc /drivers/net/wireless/mwifiex/join.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/join.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/join.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c index 5cdad92277f..62b4c293860 100644 --- a/drivers/net/wireless/mwifiex/join.c +++ b/drivers/net/wireless/mwifiex/join.c @@ -147,13 +147,12 @@ static int mwifiex_get_common_rates(struct mwifiex_private *priv, u8 *rate1, u8 *ptr = rate1, *tmp; u32 i, j; - tmp = kmalloc(rate1_size, GFP_KERNEL); + tmp = kmemdup(rate1, rate1_size, GFP_KERNEL); if (!tmp) { dev_err(priv->adapter->dev, "failed to alloc tmp buf\n"); return -ENOMEM; } - memcpy(tmp, rate1, rate1_size); memset(rate1, 0, rate1_size); for (i = 0; rate2[i] && i < rate2_size; i++) { |