diff options
Diffstat (limited to 'drivers/net/sun3lance.c')
| -rw-r--r-- | drivers/net/sun3lance.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c index c62e85d89f41..7bee45b42a2c 100644 --- a/drivers/net/sun3lance.c +++ b/drivers/net/sun3lance.c | |||
| @@ -336,13 +336,27 @@ static int __init lance_probe( struct net_device *dev) | |||
| 336 | 336 | ||
| 337 | /* XXX - leak? */ | 337 | /* XXX - leak? */ |
| 338 | MEM = dvma_malloc_align(sizeof(struct lance_memory), 0x10000); | 338 | MEM = dvma_malloc_align(sizeof(struct lance_memory), 0x10000); |
| 339 | if (MEM == NULL) { | ||
| 340 | #ifdef CONFIG_SUN3 | ||
| 341 | iounmap((void __iomem *)ioaddr); | ||
| 342 | #endif | ||
| 343 | printk(KERN_WARNING "SUN3 Lance couldn't allocate DVMA memory\n"); | ||
| 344 | return 0; | ||
| 345 | } | ||
| 339 | 346 | ||
| 340 | lp->iobase = (volatile unsigned short *)ioaddr; | 347 | lp->iobase = (volatile unsigned short *)ioaddr; |
| 341 | dev->base_addr = (unsigned long)ioaddr; /* informational only */ | 348 | dev->base_addr = (unsigned long)ioaddr; /* informational only */ |
| 342 | 349 | ||
| 343 | REGA(CSR0) = CSR0_STOP; | 350 | REGA(CSR0) = CSR0_STOP; |
| 344 | 351 | ||
| 345 | request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev); | 352 | if (request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev) < 0) { |
| 353 | #ifdef CONFIG_SUN3 | ||
| 354 | iounmap((void __iomem *)ioaddr); | ||
| 355 | #endif | ||
| 356 | dvma_free((void *)MEM); | ||
| 357 | printk(KERN_WARNING "SUN3 Lance unable to allocate IRQ\n"); | ||
| 358 | return 0; | ||
| 359 | } | ||
| 346 | dev->irq = (unsigned short)LANCE_IRQ; | 360 | dev->irq = (unsigned short)LANCE_IRQ; |
| 347 | 361 | ||
| 348 | 362 | ||
