From: Jeff Garzik <jgarzik@pobox.com>
To: Max Krasnyansky <maxk@qualcomm.com>
Cc: Stephen Hemminger <shemminger@osdl.org>,
"David S. Miller" <davem@redhat.com>,
netdev@oss.sgi.com
Subject: Re: [PATCH 2.5.70+] tun using alloc_netdev
Date: Wed, 11 Jun 2003 15:43:18 -0400 [thread overview]
Message-ID: <20030611194317.GE31051@gtf.org> (raw)
In-Reply-To: <5.1.0.14.2.20030611121155.0b659e20@unixmail.qualcomm.com>
On Wed, Jun 11, 2003 at 12:21:44PM -0700, Max Krasnyansky wrote:
> At 11:58 AM 6/9/2003, Stephen Hemminger wrote:
>
>
> >- if ((err = dev_alloc_name(&tun->dev, name)) < 0)
> >- goto failed;
> >- if ((err = register_netdevice(&tun->dev)))
> >+ dev = alloc_netdev(sizeof(struct tun_struct), name,
> >+ tun_setup);
> >+ if (!dev)
> >+ return -ENOMEM;
> >+
> >+ tun = dev->priv;
> >+ tun->flags = flags;
> >+
> >+ if ((err = register_netdevice(tun->dev))) {
> >+ kfree(dev);
> > goto failed;
> >+ }
>
>
> This is wrong. register_netdevice() does not expand name (ie %d stuff).
> So dev_alloc_name() is still needed. i.e.
Correct.
But, register_netdev() is preferred precisely for this reason.
Jeff
next prev parent reply other threads:[~2003-06-11 19:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-09 18:58 [PATCH 2.5.70+] tun using alloc_netdev Stephen Hemminger
2003-06-09 19:00 ` David S. Miller
2003-06-11 19:21 ` Max Krasnyansky
2003-06-11 19:43 ` Jeff Garzik [this message]
2003-06-11 20:27 ` Stephen Hemminger
2003-06-11 21:03 ` Max Krasnyansky
2003-06-12 3:59 ` David S. Miller
2003-06-12 3:57 ` David S. Miller
2003-06-12 8:11 ` David S. Miller
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=20030611194317.GE31051@gtf.org \
--to=jgarzik@pobox.com \
--cc=davem@redhat.com \
--cc=maxk@qualcomm.com \
--cc=netdev@oss.sgi.com \
--cc=shemminger@osdl.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.