aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2007-02-10 17:57:57 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-04-29 18:00:30 -0400
commit2cd556ae61c862f4d00bb63863c6e5c67fd55bd4 (patch)
treea20848309b3f04d06b6ddbeae59fe13ddfed29e3 /drivers/ieee1394
parent157188cb54b22e5c0c6439ef0500ba97b068097a (diff)
ieee1394: eth1394: clean up host removal
ether1394_add_host() guarantees that hi->dev != NULL if hi != NULL. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r--drivers/ieee1394/eth1394.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index e2b84c9b83bb..63fca140ab90 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -655,24 +655,17 @@ out:
655static void ether1394_remove_host (struct hpsb_host *host) 655static void ether1394_remove_host (struct hpsb_host *host)
656{ 656{
657 struct eth1394_host_info *hi; 657 struct eth1394_host_info *hi;
658 struct eth1394_priv *priv;
658 659
659 hi = hpsb_get_hostinfo(&eth1394_highlevel, host); 660 hi = hpsb_get_hostinfo(&eth1394_highlevel, host);
660 if (hi != NULL) { 661 if (!hi)
661 struct eth1394_priv *priv = netdev_priv(hi->dev); 662 return;
662 663 priv = netdev_priv(hi->dev);
663 hpsb_unregister_addrspace(&eth1394_highlevel, host, 664 hpsb_unregister_addrspace(&eth1394_highlevel, host, priv->local_fifo);
664 priv->local_fifo); 665 if (priv->iso)
665 666 hpsb_iso_shutdown(priv->iso);
666 if (priv->iso != NULL) 667 unregister_netdev(hi->dev);
667 hpsb_iso_shutdown(priv->iso); 668 free_netdev(hi->dev);
668
669 if (hi->dev) {
670 unregister_netdev (hi->dev);
671 free_netdev(hi->dev);
672 }
673 }
674
675 return;
676} 669}
677 670
678/* A reset has just arisen */ 671/* A reset has just arisen */
@@ -689,7 +682,7 @@ static void ether1394_host_reset (struct hpsb_host *host)
689 hi = hpsb_get_hostinfo(&eth1394_highlevel, host); 682 hi = hpsb_get_hostinfo(&eth1394_highlevel, host);
690 683
691 /* This can happen for hosts that we don't use */ 684 /* This can happen for hosts that we don't use */
692 if (hi == NULL) 685 if (!hi)
693 return; 686 return;
694 687
695 dev = hi->dev; 688 dev = hi->dev;