Skip to content

Commit

Permalink
mac80211: fix error in sizeof() usage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Cong Ding authored and Johannes Berg committed Feb 6, 2013
1 parent c49dc90 commit 9887dbf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9887dbf

Please sign in to comment.