]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ieee1394: eth1394: unregister address space in failure case
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Sat, 10 Feb 2007 22:56:38 +0000 (23:56 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Sun, 29 Apr 2007 22:00:30 +0000 (00:00 +0200)
Warn if hpsb_allocate_and_register_addrspace() failed.
Unregister the address space if something else failed.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/ieee1394/eth1394.c

index a364003ba47f3218703e60152ddf8befa4d89842..e2b84c9b83bb832346d285c7078bcced1c13c1c5 100644 (file)
@@ -568,8 +568,10 @@ static void ether1394_add_host (struct hpsb_host *host)
                        &eth1394_highlevel, host, &addr_ops,
                        ETHER1394_REGION_ADDR_LEN, ETHER1394_REGION_ADDR_LEN,
                        CSR1212_INVALID_ADDR_SPACE, CSR1212_INVALID_ADDR_SPACE);
-       if (fifo_addr == CSR1212_INVALID_ADDR_SPACE)
-               goto out;
+       if (fifo_addr == CSR1212_INVALID_ADDR_SPACE) {
+               ETH1394_PRINT_G(KERN_ERR, "Cannot register CSR space\n");
+               return;
+       }
 
        /* We should really have our own alloc_hpsbdev() function in
         * net_init.c instead of calling the one for ethernet then hijacking
@@ -640,16 +642,13 @@ static void ether1394_add_host (struct hpsb_host *host)
                else
                        priv->bc_state = ETHER1394_BC_RUNNING;
        }
-
        return;
-
 out:
-       if (dev != NULL)
+       if (dev)
                free_netdev(dev);
        if (hi)
                hpsb_destroy_hostinfo(&eth1394_highlevel, host);
-
-       return;
+       hpsb_unregister_addrspace(&eth1394_highlevel, host, fifo_addr);
 }
 
 /* Remove a card from our list */