* drivers/net/niu.c: memcpy(dev->dev_addr, dev->perm_addr, dev->addr_len)?
@ 2008-03-20 21:01 Roel Kluin
2008-03-20 21:25 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Roel Kluin @ 2008-03-20 21:01 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
in drivers/net/niu.c, line 6406, 6286 and 7173:
memcpy(dev->dev_addr, dev->perm_addr, dev->addr_len);
I noticed that "
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len)
occurs much more often (15x). could it be that the first two arguments
are swapped in niu.c?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: drivers/net/niu.c: memcpy(dev->dev_addr, dev->perm_addr, dev->addr_len)?
2008-03-20 21:01 drivers/net/niu.c: memcpy(dev->dev_addr, dev->perm_addr, dev->addr_len)? Roel Kluin
@ 2008-03-20 21:25 ` David Miller
2008-03-20 23:01 ` Roel Kluin
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2008-03-20 21:25 UTC (permalink / raw)
To: 12o3l; +Cc: netdev
From: Roel Kluin <12o3l@tiscali.nl>
Date: Thu, 20 Mar 2008 22:01:02 +0100
> in drivers/net/niu.c, line 6406, 6286 and 7173:
>
> memcpy(dev->dev_addr, dev->perm_addr, dev->addr_len);
>
> I noticed that "
>
> memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len)
>
> occurs much more often (15x). could it be that the first two arguments
> are swapped in niu.c?
No, these calls are correct. We are probing the device's permanent
ethernet address, we first place it into dev->dev_addr and then we
copy it into dev->perm_addr.
Please try to actually understand the pieces of strcpy and memcpy code
you are "finding bugs" in before posting to the list as these analysis
on false positives are going to eat up a lot of developer time.
I notice you posting several of these kinds of things.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: drivers/net/niu.c: memcpy(dev->dev_addr, dev->perm_addr, dev->addr_len)?
2008-03-20 21:25 ` David Miller
@ 2008-03-20 23:01 ` Roel Kluin
2008-03-21 13:07 ` Kalle Valo
0 siblings, 1 reply; 5+ messages in thread
From: Roel Kluin @ 2008-03-20 23:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev
David Miller wrote:
> From: Roel Kluin <12o3l@tiscali.nl>
> Date: Thu, 20 Mar 2008 22:01:02 +0100
>
>> in drivers/net/niu.c, line 6406, 6286 and 7173:
>>
>> memcpy(dev->dev_addr, dev->perm_addr, dev->addr_len);
>>
>> I noticed that "
>>
>> memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len)
>>
>> occurs much more often (15x). could it be that the first two arguments
>> are swapped in niu.c?
>
> No, these calls are correct. We are probing the device's permanent
> ethernet address, we first place it into dev->dev_addr and then we
> copy it into dev->perm_addr.
>
> Please try to actually understand the pieces of strcpy and memcpy code
> you are "finding bugs" in before posting to the list as these analysis
> on false positives are going to eat up a lot of developer time.
Sorry for the noise (also for sound/sparc/dbri.c) and thanks for your
answers, It takes a lot more time for me to understand the code than it
will do for someone with more knowledge and experience with this driver,
If drivers/net/niu.c copies in opposite direction compared to 80% of the
other memcpy calls - using these same variable names - and it is not
directly transparent why, My opinion is that either the naming is bad or
there is a lack of comment.
> I notice you posting several of these kinds of things.
Only 2 with the above conditions and patches or not where I was able to
figure it out myself. I don't really understand why you are opposed to
these questions.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: drivers/net/niu.c: memcpy(dev->dev_addr, dev->perm_addr, dev->addr_len)?
2008-03-20 23:01 ` Roel Kluin
@ 2008-03-21 13:07 ` Kalle Valo
0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2008-03-21 13:07 UTC (permalink / raw)
To: Roel Kluin; +Cc: David Miller, netdev
Roel Kluin <12o3l@tiscali.nl> writes:
>> I notice you posting several of these kinds of things.
>
> Only 2 with the above conditions and patches or not where I was able to
> figure it out myself. I don't really understand why you are opposed to
> these questions.
Because it will take developer's time from fixing real bugs. Time is
scarce and email takes way too much of people's time already. You will
understand this when you start getting too many emails.
--
Kalle Valo
^ permalink raw reply [flat|nested] 5+ messages in thread
* drivers/net/niu.c: memcpy(dev->dev_addr, dev->perm_addr, dev->addr_len)?
@ 2008-03-20 21:01 Roel Kluin
0 siblings, 0 replies; 5+ messages in thread
From: Roel Kluin @ 2008-03-20 21:01 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
in drivers/net/niu.c, line 6406, 6286 and 7173:
memcpy(dev->dev_addr, dev->perm_addr, dev->addr_len);
I noticed that "
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len)
occurs much more often (15x). could it be that the first two arguments
are swapped in niu.c?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-03-21 13:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-20 21:01 drivers/net/niu.c: memcpy(dev->dev_addr, dev->perm_addr, dev->addr_len)? Roel Kluin
2008-03-20 21:25 ` David Miller
2008-03-20 23:01 ` Roel Kluin
2008-03-21 13:07 ` Kalle Valo
-- strict thread matches above, loose matches on Subject: below --
2008-03-20 21:01 Roel Kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).