dev_alloc doesn't (didn't) clear the new device.

David Woodhouse (D.W.Woodhouse@nortel.co.uk)
Tue, 07 Oct 1997 09:34:05 +0100


This is a multipart MIME message.

--===_0_Tue_Oct__7_09:29:22_BST_1997
Content-Type: text/plain; charset=us-ascii

Patch against 2.1.57-vger-971005

Given that the only place dev_alloc seems to be used in the entire kernel
source is in net/tunnel.c, which is what I'm working on, I feel justified in
changing the semantics a bit.
OK?

--===_0_Tue_Oct__7_09:29:22_BST_1997
Content-Type: application/octet-stream
Content-Description: dev_alloc-clear-vger57

--- linux/net/core/dev.c.orig Tue Oct 7 09:21:22 1997
+++ linux/net/core/dev.c Tue Oct 7 09:27:07 1997
@@ -277,6 +277,7 @@
*err=-ENOBUFS;
return NULL;
}
+ memset(dev, 0, sizeof(struct device)+16);
dev->name=(char *)(dev+1); /* Name string space */
*err=dev_alloc_name(dev,name);
if(*err<0)

--===_0_Tue_Oct__7_09:29:22_BST_1997
Content-Type: text/plain; charset=us-ascii

David Woodhouse, CB3 9AN http://dwmw2.robinson.cam.ac.uk/
dwmw2@cam.ac.uk Tel: 0976 658355
( D.W.Woodhouse@nortel.co.uk Tel: 01279 402332 )

(Use the former; I'm going back to College tomorrow.)

--===_0_Tue_Oct__7_09:29:22_BST_1997--