* [patch 07/10] SUN3/3X Lance trivial fix improved
@ 2007-03-27 5:47 akpm
2007-03-28 6:19 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2007-03-27 5:47 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, gorcunov
From: "Cyrill V. Gorcunov" <gorcunov@gmail.com>
This patch adds checking for allocated DVMA memory and granted IRQ line.
Signed-off-by: Cyrill V. Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/sun3lance.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff -puN drivers/net/sun3lance.c~sun3-3x-lance-trivial-fix-improved drivers/net/sun3lance.c
--- a/drivers/net/sun3lance.c~sun3-3x-lance-trivial-fix-improved
+++ a/drivers/net/sun3lance.c
@@ -336,13 +336,27 @@ static int __init lance_probe( struct ne
/* XXX - leak? */
MEM = dvma_malloc_align(sizeof(struct lance_memory), 0x10000);
+ if (MEM == NULL) {
+#ifdef CONFIG_SUN3
+ iounmap((void __iomem *)ioaddr);
+#endif
+ printk(KERN_WARNING "SUN3 Lance couldn't allocate DVMA memory\n");
+ return 0;
+ }
lp->iobase = (volatile unsigned short *)ioaddr;
dev->base_addr = (unsigned long)ioaddr; /* informational only */
REGA(CSR0) = CSR0_STOP;
- request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev);
+ if (request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev) < 0) {
+#ifdef CONFIG_SUN3
+ iounmap((void __iomem *)ioaddr);
+#endif
+ dvma_free((void *)MEM);
+ printk(KERN_WARNING "SUN3 Lance unable to allocate IRQ\n");
+ return 0;
+ }
dev->irq = (unsigned short)LANCE_IRQ;
_
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 07/10] SUN3/3X Lance trivial fix improved
2007-03-27 5:47 [patch 07/10] SUN3/3X Lance trivial fix improved akpm
@ 2007-03-28 6:19 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-03-28 6:19 UTC (permalink / raw)
To: akpm; +Cc: netdev, gorcunov
akpm@linux-foundation.org wrote:
> From: "Cyrill V. Gorcunov" <gorcunov@gmail.com>
>
> This patch adds checking for allocated DVMA memory and granted IRQ line.
>
> Signed-off-by: Cyrill V. Gorcunov <gorcunov@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
applied to #upstream-fixes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-28 6:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-27 5:47 [patch 07/10] SUN3/3X Lance trivial fix improved akpm
2007-03-28 6:19 ` Jeff Garzik
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.