diff mbox series

[added,to,the,4.1,stable,tree] cfg80211: fix cfg80211_beacon_dup

Message ID 20180301152116.1486-507-alexander.levin@microsoft.com
State New
Headers show
Series [added,to,the,4.1,stable,tree] cfg80211: fix cfg80211_beacon_dup | expand

Commit Message

Sasha Levin March 1, 2018, 3:27 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>


This patch has been added to the 4.1 stable tree. If you have any
objections, please let us know.

-- 
2.14.1
diff mbox series

Patch

===============

[ Upstream commit bee92d06157fc39d5d7836a061c7d41289a55797 ]

gcc-8 warns about some obviously incorrect code:

net/mac80211/cfg.c: In function 'cfg80211_beacon_dup':
net/mac80211/cfg.c:2896:3: error: 'memcpy' source argument is the same as destination [-Werror=restrict]

From the context, I conclude that we want to copy from beacon into
new_beacon, as we do in the rest of the function.

Cc: stable@vger.kernel.org
Fixes: 73da7d5bab79 ("mac80211: add channel switch command and beacon callbacks")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 net/mac80211/cfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 37e0aa4891a2..cd85cbf9bf39 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2857,7 +2857,7 @@  cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon)
 	}
 	if (beacon->probe_resp_len) {
 		new_beacon->probe_resp_len = beacon->probe_resp_len;
-		beacon->probe_resp = pos;
+		new_beacon->probe_resp = pos;
 		memcpy(pos, beacon->probe_resp, beacon->probe_resp_len);
 		pos += beacon->probe_resp_len;
 	}