ieee1394: eth1394: unregister address space in failure case
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>
This commit is contained in:
parent
ea9057ad62
commit
157188cb54
1 changed files with 6 additions and 7 deletions
|
@ -568,8 +568,10 @@ static void ether1394_add_host (struct hpsb_host *host)
|
||||||
ð1394_highlevel, host, &addr_ops,
|
ð1394_highlevel, host, &addr_ops,
|
||||||
ETHER1394_REGION_ADDR_LEN, ETHER1394_REGION_ADDR_LEN,
|
ETHER1394_REGION_ADDR_LEN, ETHER1394_REGION_ADDR_LEN,
|
||||||
CSR1212_INVALID_ADDR_SPACE, CSR1212_INVALID_ADDR_SPACE);
|
CSR1212_INVALID_ADDR_SPACE, CSR1212_INVALID_ADDR_SPACE);
|
||||||
if (fifo_addr == CSR1212_INVALID_ADDR_SPACE)
|
if (fifo_addr == CSR1212_INVALID_ADDR_SPACE) {
|
||||||
goto out;
|
ETH1394_PRINT_G(KERN_ERR, "Cannot register CSR space\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* We should really have our own alloc_hpsbdev() function in
|
/* We should really have our own alloc_hpsbdev() function in
|
||||||
* net_init.c instead of calling the one for ethernet then hijacking
|
* 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
|
else
|
||||||
priv->bc_state = ETHER1394_BC_RUNNING;
|
priv->bc_state = ETHER1394_BC_RUNNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (dev != NULL)
|
if (dev)
|
||||||
free_netdev(dev);
|
free_netdev(dev);
|
||||||
if (hi)
|
if (hi)
|
||||||
hpsb_destroy_hostinfo(ð1394_highlevel, host);
|
hpsb_destroy_hostinfo(ð1394_highlevel, host);
|
||||||
|
hpsb_unregister_addrspace(ð1394_highlevel, host, fifo_addr);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove a card from our list */
|
/* Remove a card from our list */
|
||||||
|
|
Loading…
Add table
Reference in a new issue