Thread (4 messages) 4 messages, 2 authors, 2010-12-30

Re: [PATCH 03/10] net/fec: add mac field into platform data and consolidate fec_get_mac

STALE5753d

From: Uwe Kleine-König <hidden>
Date: 2010-12-29 12:42:21
Also in: linux-arm-kernel

Hello Shawn,

On Wed, Dec 29, 2010 at 07:58:09PM +0800, Shawn Guo wrote:
On Wed, Dec 29, 2010 at 11:31:38AM +0100, Uwe Kleine-König wrote:
quoted
On Wed, Dec 29, 2010 at 06:05:21PM +0800, Shawn Guo wrote:
quoted
On Wed, Dec 29, 2010 at 08:53:30AM +0200, Baruch Siach wrote:
	if (iap == fec_mac_default)
		dev->dev_addr[ETH_ALEN-1] = fec_mac_default[ETH_ALEN-1] + fep->pdev->id;
Can this overflow?  (I didn't check the code, so my concern might be
completely stupid here.)
No. dev->dev_addr points to netdev_hw_addr->addr, which is a 32 bytes array.
I didn't mean an out-of-bound access, but what is if
fec_mac_default[ETH_ALEN-1] is 0xff and you add 1?  Does that result in
0x100 or 0?  What if id is <0?  For big ids you might even handle a
carry to indixes <ETH_ALEN-2.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help