aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/hamradio/dmascc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c
index c3d377770616..e4137c1b3df9 100644
--- a/drivers/net/hamradio/dmascc.c
+++ b/drivers/net/hamradio/dmascc.c
@@ -451,7 +451,7 @@ static const struct net_device_ops scc_netdev_ops = {
451 451
452static int __init setup_adapter(int card_base, int type, int n) 452static int __init setup_adapter(int card_base, int type, int n)
453{ 453{
454 int i, irq, chip; 454 int i, irq, chip, err;
455 struct scc_info *info; 455 struct scc_info *info;
456 struct net_device *dev; 456 struct net_device *dev;
457 struct scc_priv *priv; 457 struct scc_priv *priv;
@@ -463,14 +463,17 @@ static int __init setup_adapter(int card_base, int type, int n)
463 463
464 /* Initialize what is necessary for write_scc and write_scc_data */ 464 /* Initialize what is necessary for write_scc and write_scc_data */
465 info = kzalloc(sizeof(struct scc_info), GFP_KERNEL | GFP_DMA); 465 info = kzalloc(sizeof(struct scc_info), GFP_KERNEL | GFP_DMA);
466 if (!info) 466 if (!info) {
467 err = -ENOMEM;
467 goto out; 468 goto out;
469 }
468 470
469 info->dev[0] = alloc_netdev(0, "", NET_NAME_UNKNOWN, dev_setup); 471 info->dev[0] = alloc_netdev(0, "", NET_NAME_UNKNOWN, dev_setup);
470 if (!info->dev[0]) { 472 if (!info->dev[0]) {
471 printk(KERN_ERR "dmascc: " 473 printk(KERN_ERR "dmascc: "
472 "could not allocate memory for %s at %#3x\n", 474 "could not allocate memory for %s at %#3x\n",
473 hw[type].name, card_base); 475 hw[type].name, card_base);
476 err = -ENOMEM;
474 goto out1; 477 goto out1;
475 } 478 }
476 479
@@ -479,6 +482,7 @@ static int __init setup_adapter(int card_base, int type, int n)
479 printk(KERN_ERR "dmascc: " 482 printk(KERN_ERR "dmascc: "
480 "could not allocate memory for %s at %#3x\n", 483 "could not allocate memory for %s at %#3x\n",
481 hw[type].name, card_base); 484 hw[type].name, card_base);
485 err = -ENOMEM;
482 goto out2; 486 goto out2;
483 } 487 }
484 spin_lock_init(&info->register_lock); 488 spin_lock_init(&info->register_lock);
@@ -549,6 +553,7 @@ static int __init setup_adapter(int card_base, int type, int n)
549 printk(KERN_ERR 553 printk(KERN_ERR
550 "dmascc: could not find irq of %s at %#3x (irq=%d)\n", 554 "dmascc: could not find irq of %s at %#3x (irq=%d)\n",
551 hw[type].name, card_base, irq); 555 hw[type].name, card_base, irq);
556 err = -ENODEV;
552 goto out3; 557 goto out3;
553 } 558 }
554 559
@@ -585,11 +590,13 @@ static int __init setup_adapter(int card_base, int type, int n)
585 if (register_netdev(info->dev[0])) { 590 if (register_netdev(info->dev[0])) {
586 printk(KERN_ERR "dmascc: could not register %s\n", 591 printk(KERN_ERR "dmascc: could not register %s\n",
587 info->dev[0]->name); 592 info->dev[0]->name);
593 err = -ENODEV;
588 goto out3; 594 goto out3;
589 } 595 }
590 if (register_netdev(info->dev[1])) { 596 if (register_netdev(info->dev[1])) {
591 printk(KERN_ERR "dmascc: could not register %s\n", 597 printk(KERN_ERR "dmascc: could not register %s\n",
592 info->dev[1]->name); 598 info->dev[1]->name);
599 err = -ENODEV;
593 goto out4; 600 goto out4;
594 } 601 }
595 602
@@ -612,7 +619,7 @@ static int __init setup_adapter(int card_base, int type, int n)
612 out1: 619 out1:
613 kfree(info); 620 kfree(info);
614 out: 621 out:
615 return -1; 622 return err;
616} 623}
617 624
618 625