diff options
author | Julia Lawall <julia@diku.dk> | 2009-12-13 00:47:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-13 22:56:35 -0500 |
commit | 6057912d7baad31be9819518674ffad349a065b1 (patch) | |
tree | 73cf227b2f00b170041c9e2f7ea8dfa6dd9af38b /drivers/net/usb/rtl8150.c | |
parent | 2447f2f3c38d3058d50de93df225ee6ad295932b (diff) |
drivers/net/usb: Correct code taking the size of a pointer
sizeof(dev->dev_addr) is the size of a pointer. A few lines above, the
size of this field is obtained using netdev->addr_len for a call to memcpy,
so do the same here.
A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression *x;
expression f;
type T;
@@
*f(...,(T)x,...)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/rtl8150.c')
-rw-r--r-- | drivers/net/usb/rtl8150.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index b091e20ca167..f14d225404da 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c | |||
@@ -324,7 +324,7 @@ static int rtl8150_set_mac_address(struct net_device *netdev, void *p) | |||
324 | dbg("%02X:", netdev->dev_addr[i]); | 324 | dbg("%02X:", netdev->dev_addr[i]); |
325 | dbg("%02X\n", netdev->dev_addr[i]); | 325 | dbg("%02X\n", netdev->dev_addr[i]); |
326 | /* Set the IDR registers. */ | 326 | /* Set the IDR registers. */ |
327 | set_registers(dev, IDR, sizeof(netdev->dev_addr), netdev->dev_addr); | 327 | set_registers(dev, IDR, netdev->addr_len, netdev->dev_addr); |
328 | #ifdef EEPROM_WRITE | 328 | #ifdef EEPROM_WRITE |
329 | { | 329 | { |
330 | u8 cr; | 330 | u8 cr; |