netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: julia@diku.dk
Cc: florian@openwrt.org, netdev@vger.kernel.org
Subject: Re: question about drivers/net/cpmac.c
Date: Sun, 13 Dec 2009 02:39:51 -0800 (PST)	[thread overview]
Message-ID: <20091213.023951.240636069.davem@davemloft.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0912131119540.24267@ask.diku.dk>

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


  parent reply	other threads:[~2009-12-13 10:39 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 ` David Miller [this message]
2009-12-13 11:00   ` question about drivers/net/cpmac.c Julia Lawall
2009-12-13 11:51     ` Ben Hutchings
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=20091213.023951.240636069.davem@davemloft.net \
    --to=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 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).