[34-longterm 145/209] driver/net/benet: fix be_cmd_multicast_set() memcpy bug

From: Paul Gortmaker
Date: Thu Apr 14 2011 - 14:16:52 EST


From: Joe Jin <joe.jin@xxxxxxxxxx>

=====================================================================
| This is a commit scheduled for the next v2.6.34 longterm release. |
| If you see a problem with using this for longterm, please comment.|
=====================================================================

commit 408cc293c29ada769ae772420a39961320da1854 upstream

Regarding benet be_cmd_multicast_set() function, now using
netdev_for_each_mc_addr() helper for mac address copy, but
when copying to req->mac[] did not increase of the index.

Cc: Sathya Perla <sathyap@xxxxxxxxxxxxxxxxx>
Cc: Subbu Seetharaman <subbus@xxxxxxxxxxxxxxxxx>
Cc: Sarveshwar Bandi <sarveshwarb@xxxxxxxxxxxxxxxxx>
Cc: Ajit Khaparde <ajitk@xxxxxxxxxxxxxxxxx>
Signed-off-by: Joe Jin <joe.jin@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx>
---
drivers/net/benet/be_cmds.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index d0ef4ac..e0578d1 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -1163,7 +1163,7 @@ int be_cmd_multicast_set(struct be_adapter *adapter, u32 if_id,

i = 0;
netdev_for_each_mc_addr(mc, netdev)
- memcpy(req->mac[i].byte, mc->dmi_addr, ETH_ALEN);
+ memcpy(req->mac[i++].byte, mc->dmi_addr, ETH_ALEN);
} else {
req->promiscuous = 1;
}
--
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/