patch-2.2.11 linux/drivers/net/arcnet.c
Next file: linux/drivers/net/arlan-proc.c
Previous file: linux/drivers/net/acenic_firmware.h
Back to the patch index
Back to the overall index
- Lines: 19
- Date:
Mon Aug 9 12:04:39 1999
- Orig file:
v2.2.10/linux/drivers/net/arcnet.c
- Orig date:
Mon Sep 14 11:32:22 1998
diff -u --recursive --new-file v2.2.10/linux/drivers/net/arcnet.c linux/drivers/net/arcnet.c
@@ -471,9 +471,16 @@
#ifdef CONFIG_ARCNET_1051
/* Initialize the RFC1051-encap protocol driver */
- lp->sdev=(struct device *)kmalloc(sizeof(struct device),GFP_KERNEL);
+ lp->sdev=(struct device *)kmalloc(sizeof(struct device)+10,GFP_KERNEL);
+ if(lp->sdev = NULL)
+ {
+ if(lp->edev)
+ kfree(lp->edev);
+ lp->edev=NULL;
+ return -ENOMEM;
+ }
memcpy(lp->sdev,dev,sizeof(struct device));
- lp->sdev->name=(char *)kmalloc(10,GFP_KERNEL);
+ lp->sdev->name=(char *)(lp+1);
sprintf(lp->sdev->name,"%ss",dev->name);
lp->sdev->init=arcnetS_init;
register_netdevice(lp->sdev);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)