From c42791b6ec5453cd7910eac7bfdd88f27173f81c Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Wed, 18 Jan 2006 17:42:53 -0800 Subject: [PATCH] uml: make daemon transport behave properly Avoid uninitialized data in the daemon_data structure. I used this transport before doing proper setup before-hand, and I got some very nice SLAB corruption due to freeing crap pointers. So just make sure to clear everything when appropriate. Signed-off-by: Paolo 'Blaisorblade' Giarrusso Cc: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/drivers/daemon_kern.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/um/drivers/daemon_kern.c') diff --git a/arch/um/drivers/daemon_kern.c b/arch/um/drivers/daemon_kern.c index 30d285b266af..507e3cbac9d3 100644 --- a/arch/um/drivers/daemon_kern.c +++ b/arch/um/drivers/daemon_kern.c @@ -31,6 +31,10 @@ void daemon_init(struct net_device *dev, void *data) dpri->fd = -1; dpri->control = -1; dpri->dev = dev; + /* We will free this pointer. If it contains crap we're burned. */ + dpri->ctl_addr = NULL; + dpri->data_addr = NULL; + dpri->local_addr = NULL; printk("daemon backend (uml_switch version %d) - %s:%s", SWITCH_VERSION, dpri->sock_type, dpri->ctl_sock); -- cgit v1.2.1