Skip to contentSkip to conversation

driver/net/benet: fix be_cmd_multicast_set() memcpy bug

PATCH Applied Joe Jin 2 participants 2 messages Dec 6, 2010 – Dec 8, 2010

Subsystems (2)
lore
Share & tools
lore

Joe Jin

author
#0 lore raw

PATCH 1/1 driver/net/benet: fix be_cmd_multicast_set() memcpy bug

Hi,

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 <[email protected]>
Cc Subbu Seetharaman <[email protected]>
Cc Sarveshwar Bandi <[email protected]>
Cc Ajit Khaparde <[email protected]>
---
 be_cmds.c |    2 +-
drivers/net/benet/be_cmds.c +1 -1
index 36eca1c..e4465d2 100644
@@ -1235,7 +1235,7 @@ int be_cmd_multicast_set(struct be_adapter *adapter, u32 if_id,
 
 		i = 0;
 		netdev_for_each_mc_addr(ha, netdev)
-			memcpy(req->mac[i].byte, ha->addr, ETH_ALEN);
+			memcpy(req->mac[i++].byte, ha->addr, ETH_ALEN);
 	} else {
 		req->promiscuous = 1;
 	}
Signature · 4 lines
Oracle <http://www.oracle.com>
Joe Jin | Team Leader, Software Development | +8610.8278.6295
ORACLE | Linux and Virtualization
Incubator Building 2-A ZPark | Beijing China, 100094
maintainer Applied
#1 lore raw

From: Joe Jin <[email protected]>
Date: Mon, 6 Dec 2010 21:00:59 +0800

Quoted 11 lines

Hi,

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 <[email protected]>
Cc Subbu Seetharaman <[email protected]>
Cc Sarveshwar Bandi <[email protected]>
Cc Ajit Khaparde <[email protected]>

Applied, thank you.