patch-2.2.16 linux/drivers/net/comx.c

Next file: linux/drivers/net/comx.h
Previous file: linux/drivers/net/comx-proto-ppp.c
Back to the patch index
Back to the overall index

diff -urN v2.2.15/linux/drivers/net/comx.c linux/drivers/net/comx.c
@@ -890,12 +890,10 @@
 	debug_file->write_proc = &comx_write_proc;
 	debug_file->nlink = 1;
 
-	/* struct ppp_device is a bit larger then struct device and the
-	   syncppp driver needs it */
-	if ((dev = kmalloc(sizeof(struct ppp_device), GFP_KERNEL)) == NULL) {
+	if ((dev = kmalloc(sizeof(struct device), GFP_KERNEL)) == NULL) {
 		return -ENOMEM;
 	}
-	memset(dev, 0, sizeof(struct ppp_device));
+	memset(dev, 0, sizeof(struct device));
 	dev->name = (char *)new_dir->name;
 	dev->init = comx_init_dev;
 
@@ -903,6 +901,11 @@
 		return -EIO;
 	}
 	ch=dev->priv;
+	if((ch->if_ptr = (void *)kmalloc(sizeof(struct ppp_device),
+				 GFP_KERNEL)) == NULL) {
+		return -ENOMEM;
+	}
+	memset(ch->if_ptr, 0, sizeof(struct ppp_device));
 	ch->debug_file = debug_file; 
 	ch->procdir = new_dir;
 	new_dir->data = dev;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)