diff --git a/patches.suse/wcn36xx-Use-kmemdup-instead-of-duplicating-it-in-wcn.patch b/patches.suse/wcn36xx-Use-kmemdup-instead-of-duplicating-it-in-wcn.patch new file mode 100644 index 0000000..a37b9e1 --- /dev/null +++ b/patches.suse/wcn36xx-Use-kmemdup-instead-of-duplicating-it-in-wcn.patch @@ -0,0 +1,39 @@ +From 3f96556f639e6cc507cc682406e83671f8e7c1ea Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Mon, 6 Aug 2018 12:39:07 +0300 +Subject: [PATCH] wcn36xx: Use kmemdup instead of duplicating it in + wcn36xx_smd_process_ptt_msg_rsp +Git-commit: 3f96556f639e6cc507cc682406e83671f8e7c1ea +References: git-fixes +Patch-mainline: v4.20-rc1 + +Replace calls to kmalloc followed by a memcpy with a direct call to +kmemdup. + +Signed-off-by: YueHaibing +Signed-off-by: Kalle Valo +Signed-off-by: Oliver Neukum +--- + drivers/net/wireless/ath/wcn36xx/smd.c | 4 ++-- + 1 file 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; + } +-- +2.40.1 + diff --git a/series.conf b/series.conf index e041690..2a08a5c 100644 --- a/series.conf +++ b/series.conf @@ -42206,6 +42206,7 @@ patches.suse/ice-Add-support-for-dynamic-interrupt-moderation.patch patches.suse/ice-Fix-error-on-driver-remove.patch patches.suse/ath10k-fix-kernel-panic-by-moving-pci-flush-after-na.patch + patches.suse/wcn36xx-Use-kmemdup-instead-of-duplicating-it-in-wcn.patch patches.suse/ath10k-skip-resetting-rx-filter-for-WCN3990.patch patches.suse/ath10k-schedule-hardware-restart-if-WMI-command-time.patch patches.suse/ath9k-fix-tx99-with-monitor-mode-interface.patch