diff options
author | Andrei Epure <epure.andrei@gmail.com> | 2013-03-10 15:22:33 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-03-20 14:17:07 +0100 |
commit | 5649ce429e81b77919c0029a02edf44df3be7797 (patch) | |
tree | 11bb5a2d4bea3d647a5f6a476236beff3314bdcc /drivers/net/wireless/iwlwifi/iwl-test.c | |
parent | 398e8c6c4eea39853a80cc1513f80026c1a62519 (diff) | |
download | op-kernel-dev-5649ce429e81b77919c0029a02edf44df3be7797.zip op-kernel-dev-5649ce429e81b77919c0029a02edf44df3be7797.tar.gz |
iwlwifi: use kmemdup instead of kmalloc+memcpy
Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-test.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-test.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-test.c b/drivers/net/wireless/iwlwifi/iwl-test.c index efff298..5cfd55b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-test.c +++ b/drivers/net/wireless/iwlwifi/iwl-test.c @@ -272,7 +272,7 @@ static int iwl_test_fw_cmd(struct iwl_test *tst, struct nlattr **tb) reply_len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK; skb = iwl_test_alloc_reply(tst, reply_len + 20); - reply_buf = kmalloc(reply_len, GFP_KERNEL); + reply_buf = kmemdup(&pkt->hdr, reply_len, GFP_KERNEL); if (!skb || !reply_buf) { kfree_skb(skb); kfree(reply_buf); @@ -280,7 +280,6 @@ static int iwl_test_fw_cmd(struct iwl_test *tst, struct nlattr **tb) } /* The reply is in a page, that we cannot send to user space. */ - memcpy(reply_buf, &(pkt->hdr), reply_len); iwl_free_resp(&cmd); if (nla_put_u32(skb, IWL_TM_ATTR_COMMAND, |