]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
nl80211: do a struct assignment to radar_chandef instead of memcpy()
authorLuca Coelho <luciano.coelho@intel.com>
Wed, 17 Apr 2019 06:34:40 +0000 (09:34 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 26 Apr 2019 11:02:11 +0000 (13:02 +0200)
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 <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index 0524a6fb84ad14572aad2012bac9b9f9bde0d2c5..5dfc4dba9e56502465b63eabdd2cadf594667677 100644 (file)
@@ -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);