From a680fe468df7550ed18fbcae30e382252fdc35c6 Mon Sep 17 00:00:00 2001 From: Luca Coelho Date: Wed, 17 Apr 2019 09:34:40 +0300 Subject: [PATCH] nl80211: do a struct assignment to radar_chandef instead of memcpy() We are copying one entire structure to another of the same type in nl80211_notify_radar_detection, so it's simpler and safer to do a struct assignment instead of memcpy(). Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg --- net/wireless/nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 0524a6f..5dfc4db 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -8181,7 +8181,7 @@ static int nl80211_notify_radar_detection(struct sk_buff *skb, cfg80211_sched_dfs_chan_update(rdev); - memcpy(&rdev->radar_chandef, &chandef, sizeof(chandef)); + rdev->radar_chandef = chandef; /* Propagate this notification to other radios as well */ queue_work(cfg80211_wq, &rdev->propagate_radar_detect_wk); -- 2.7.4