All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: mac80211/cfg.c: fix error using of sizeof()
@ 2013-02-06 16:23 Cong Ding
  2013-02-06 16:27 ` Johannes Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Cong Ding @ 2013-02-06 16:23 UTC (permalink / raw)
  To: Johannes Berg, John W. Linville, David S. Miller, linux-wireless,
	netdev, linux-kernel
  Cc: Cong Ding

Using 'sizeof' on array given as function argument returns size of a pointer
rather than the size of array.

Signed-off-by: Cong Ding <dinggnu@gmail.com>
---
 net/mac80211/cfg.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 661b878..af561d5 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2058,7 +2058,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;
 }
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-02-06 19:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-06 16:23 [PATCH] net: mac80211/cfg.c: fix error using of sizeof() Cong Ding
2013-02-06 16:27 ` Johannes Berg
2013-02-06 17:54   ` Ben Greear
2013-02-06 17:59     ` Ben Greear
2013-02-06 17:58 ` Ben Greear
2013-02-06 17:58   ` Ben Greear
2013-02-06 18:33 ` David Miller
2013-02-06 19:28   ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.