xpp: make unregistration safer (idempotent)
* Otherwise, a failed unit initialization (e.g: when init_card_?_?? fails) causes a panic Signed-off-by: Oron Peled <oron.peled@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10282 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
parent
bfae9c07da
commit
aab9e51f30
@ -939,6 +939,7 @@ static void xbus_unregister_dahdi_device(xbus_t *xbus)
|
||||
xpd_t *xpd = xpd_of(xbus, i);
|
||||
xpd_dahdi_preunregister(xpd);
|
||||
}
|
||||
if (xbus->ddev) {
|
||||
dahdi_unregister_device(xbus->ddev);
|
||||
XBUS_NOTICE(xbus, "%s: finished dahdi_unregister_device()\n", __func__);
|
||||
kfree(xbus->ddev->devicetype);
|
||||
@ -947,6 +948,7 @@ static void xbus_unregister_dahdi_device(xbus_t *xbus)
|
||||
xbus->ddev->hardware_id = NULL;
|
||||
dahdi_free_device(xbus->ddev);
|
||||
xbus->ddev = NULL;
|
||||
}
|
||||
for(i = 0; i < MAX_XPDS; i++) {
|
||||
xpd_t *xpd = xpd_of(xbus, i);
|
||||
xpd_dahdi_postunregister(xpd);
|
||||
|
Loading…
Reference in New Issue
Block a user