From: Ben Hutchings <bhutchings@solarflare.com>
To: Julia Lawall <julia@diku.dk>
Cc: David Miller <davem@davemloft.net>,
florian@openwrt.org, netdev@vger.kernel.org
Subject: Re: question about drivers/net/cpmac.c
Date: Sun, 13 Dec 2009 11:51:59 +0000 [thread overview]
Message-ID: <1260705119.4532.609.camel@localhost> (raw)
In-Reply-To: <Pine.LNX.4.64.0912131143571.24267@ask.diku.dk>
On Sun, 2009-12-13 at 12:00 +0100, Julia Lawall wrote:
> On Sun, 13 Dec 2009, David Miller wrote:
>
> > From: Julia Lawall <julia@diku.dk>
> > Date: Sun, 13 Dec 2009 11:22:54 +0100 (CET)
> >
> > > The function __devinit cpmac_probe in the file drivers/net/cpmac.c
> > > contains the following code:
> > >
> > > memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));
> > >
> > > Is it correct that the size of the pointer is what is wanted?
> >
> > Everything that does sizeof(netdev->dev_addr) is a bug.
> >
> > At some point we changed netdev->dev_addr from an array of chars to a
> > pointer to a dynamically allocated buffer.
> >
> > So these cases worked before that change and need to be updated
> > in order to be correct.
> >
> > Looking quickly there are a couple of these things under
> > drivers/net
>
> Fixed how? I looked a bit to find where the field was initialized, but it
> is just initialized to a field of something else, so it was not so
> clear what the size should be.
[...]
The size should be dev->addr_len (assuming that has already been
initialised) which will be ETH_ALEN for Ethernet devices.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2009-12-13 11:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-13 10:22 question about drivers/net/cpmac.c Julia Lawall
2009-12-13 10:25 ` question about drivers/net/3c507.c Julia Lawall
2009-12-13 10:40 ` David Miller
2009-12-13 10:39 ` question about drivers/net/cpmac.c David Miller
2009-12-13 11:00 ` Julia Lawall
2009-12-13 11:51 ` Ben Hutchings [this message]
2009-12-13 12:19 ` Florian Fainelli
2009-12-13 12:43 ` Julia Lawall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1260705119.4532.609.camel@localhost \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=florian@openwrt.org \
--cc=julia@diku.dk \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.