mac80211: fix error in sizeof() usage
authorCong Ding <dinggnu@gmail.com>
Wed, 6 Feb 2013 16:23:45 +0000 (17:23 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 6 Feb 2013 16:31:55 +0000 (17:31 +0100)
Using 'sizeof' on array given as function argument returns
size of a pointer rather than the size of array.

Cc: stable@vger.kernel.org
Signed-off-by: Cong Ding <dinggnu@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c

index 516fbc96feff11831a9ad308541e6bdc16a7089d..0479c64aa83cc8beb27a90dedd1340cbeb2065a2 100644 (file)
@@ -2004,7 +2004,8 @@ static int ieee80211_set_mcast_rate(struct wiphy *wiphy, struct net_device *dev,
 {
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
-       memcpy(sdata->vif.bss_conf.mcast_rate, rate, sizeof(rate));
+       memcpy(sdata->vif.bss_conf.mcast_rate, rate,
+              sizeof(int) * IEEE80211_NUM_BANDS);
 
        return 0;
 }