Subject: Re: [patch 2/5][RFC] Update net core to use devres.

From: Brandon Philips <[email-masked]>
Date: Fri, 3 Aug 2007 02:39:07 -0700

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