diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-08-06 12:39:07 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-08-24 14:48:27 +0300 |
commit | 3f96556f639e6cc507cc682406e83671f8e7c1ea (patch) | |
tree | 9b84120fa089d3a44e0694895a6dcca7f43a3100 | |
parent | bd1d395070cca4f42a93e520b0597274789274a4 (diff) | |
download | lwn-3f96556f639e6cc507cc682406e83671f8e7c1ea.tar.gz lwn-3f96556f639e6cc507cc682406e83671f8e7c1ea.zip |
wcn36xx: Use kmemdup instead of duplicating it in wcn36xx_smd_process_ptt_msg_rsp
Replace calls to kmalloc followed by a memcpy with a direct call to
kmemdup.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/ath/wcn36xx/smd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 00098f24116d..1d2d698fb779 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -792,10 +792,10 @@ static int wcn36xx_smd_process_ptt_msg_rsp(void *buf, size_t len, rsp->header.len - sizeof(rsp->ptt_msg_resp_status)); if (rsp->header.len > 0) { - *p_ptt_rsp_msg = kmalloc(rsp->header.len, GFP_ATOMIC); + *p_ptt_rsp_msg = kmemdup(rsp->ptt_msg, rsp->header.len, + GFP_ATOMIC); if (!*p_ptt_rsp_msg) return -ENOMEM; - memcpy(*p_ptt_rsp_msg, rsp->ptt_msg, rsp->header.len); } return ret; } |