summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dahdi/xpp')
-rw-r--r--drivers/dahdi/xpp/xbus-core.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/dahdi/xpp/xbus-core.c b/drivers/dahdi/xpp/xbus-core.c
index 7fe0493..b2f7616 100644
--- a/drivers/dahdi/xpp/xbus-core.c
+++ b/drivers/dahdi/xpp/xbus-core.c
@@ -939,14 +939,16 @@ static void xbus_unregister_dahdi_device(xbus_t *xbus)
xpd_t *xpd = xpd_of(xbus, i);
xpd_dahdi_preunregister(xpd);
}
- dahdi_unregister_device(xbus->ddev);
- XBUS_NOTICE(xbus, "%s: finished dahdi_unregister_device()\n", __func__);
- kfree(xbus->ddev->devicetype);
- xbus->ddev->devicetype = NULL;
- xbus->ddev->location = NULL;
- xbus->ddev->hardware_id = NULL;
- dahdi_free_device(xbus->ddev);
- xbus->ddev = NULL;
+ if (xbus->ddev) {
+ dahdi_unregister_device(xbus->ddev);
+ XBUS_NOTICE(xbus, "%s: finished dahdi_unregister_device()\n", __func__);
+ kfree(xbus->ddev->devicetype);
+ xbus->ddev->devicetype = NULL;
+ xbus->ddev->location = NULL;
+ 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);