From: Brandon Philips <bphilips@suse.de>
To: Tejun Heo <teheo@suse.de>
Cc: netdev@vger.kernel.org
Subject: Re: [patch 2/5][RFC] Update net core to use devres.
Date: Fri, 3 Aug 2007 02:39:07 -0700 [thread overview]
Message-ID: <20070803093907.GA5872@ifup.org> (raw)
In-Reply-To: <46B2F1B9.9010605@suse.de>
On 18:13 Fri 03 Aug 2007, Tejun Heo wrote:
> > + p = devres_alloc(devm_free_netdev, 0, GFP_KERNEL);
>
> s/0/sizeof(*p)/
Oops! It should have read like this:
+static void * register_netdev_devres(struct device *gendev,
+ struct net_device *dev)
+{
+ void *p;
+
+ /* 0 size because we don't need it. The net_device is already alloc'd
+ * in alloc_netdev_mq. We can't use devm_kzalloc in alloc_netdev_mq
+ * because a net_device cannot be free'd directly as it can be a
+ * kobject. See free_netdev.
+ */
+ p = devres_alloc(devm_free_netdev, 0, GFP_KERNEL);
+
+ if (unlikely(!p))
+ return NULL;
+
+ devres_add(gendev, p);
+
+ return dev;
+}
I will send the full correct patch.
Thanks,
Brandon
prev parent reply other threads:[~2007-08-03 9:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-02 22:45 [patch 2/5][RFC] Update net core to use devres Brandon Philips
2007-08-03 9:13 ` Tejun Heo
2007-08-03 9:39 ` Brandon Philips [this message]
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=20070803093907.GA5872@ifup.org \
--to=bphilips@suse.de \
--cc=netdev@vger.kernel.org \
--cc=teheo@suse.de \
/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).