]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drivers/net/usb: Correct code taking the size of a pointer
authorJulia Lawall <julia@diku.dk>
Sun, 13 Dec 2009 05:47:04 +0000 (05:47 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 6 Jan 2010 23:03:47 +0000 (15:03 -0800)
commit4ba51fe7d303115c0eef7cfe4a326fdff536302f
tree1508072da4d599b515c71b2ef4ed6c166cdd1c8b
parent526fed8b3c60bd7746de0df7676c83800c36b906
drivers/net/usb: Correct code taking the size of a pointer

commit 6057912d7baad31be9819518674ffad349a065b1 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/usb/rtl8150.c