diff options
Diffstat (limited to 'drivers/net/pcmcia/aironet4500_cs.c')
-rw-r--r-- | drivers/net/pcmcia/aironet4500_cs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/pcmcia/aironet4500_cs.c b/drivers/net/pcmcia/aironet4500_cs.c index 503e033d8..b1b3e8df1 100644 --- a/drivers/net/pcmcia/aironet4500_cs.c +++ b/drivers/net/pcmcia/aironet4500_cs.c @@ -177,8 +177,14 @@ static dev_link_t *awc_attach(void) /* Create the PC card device object. */ link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL); - memset(link, 0, sizeof(struct dev_link_t)); + if (!link) + return NULL; link->dev = kmalloc(sizeof(struct dev_node_t), GFP_KERNEL); + if (!link->dev) { + kfree(link); + return NULL; + } + memset(link, 0, sizeof(struct dev_link_t)); memset(link->dev, 0, sizeof(struct dev_node_t)); link->release.function = &awc_release; @@ -199,7 +205,6 @@ static dev_link_t *awc_attach(void) /* Create the network device object. */ dev = kmalloc(sizeof(struct net_device ), GFP_KERNEL); - memset(dev,0,sizeof(struct net_device)); // dev = init_etherdev(0, sizeof(struct awc_private) ); if (!dev ) { printk(KERN_CRIT "out of mem on dev alloc \n"); @@ -207,6 +212,7 @@ static dev_link_t *awc_attach(void) kfree(link); return NULL; }; + memset(dev,0,sizeof(struct net_device)); dev->priv = kmalloc(sizeof(struct awc_private), GFP_KERNEL); if (!dev->priv ) {printk(KERN_CRIT "out of mem on dev priv alloc \n"); return NULL;}; memset(dev->priv,0,sizeof(struct awc_private)); |