summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-11-07 22:40:15 +0000
committerShaun Ruffell <sruffell@digium.com>2011-11-07 22:40:15 +0000
commitb742903c986d4638edce98885810bff7e956c175 (patch)
tree7e620dedee58ed35969959a2af50d1fc55798b66
parentb30c64fb58f8310613e1ae4ce5958136bf00d66b (diff)
dahdi: Unregister dahdi_device from sysfs if we fail to auto assign spans.
Otherwise, if the _dahdi_assign_span call fails, the dahdi_device will never be removed from the dahdi_devices virtual bus and the board drivers will not be reloadable. Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10331 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/dahdi-base.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 67150c8..68ddfc8 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -7025,6 +7025,9 @@ static int _dahdi_register_device(struct dahdi_device *ddev,
list_for_each_entry(s, &ddev->spans, device_node)
ret = _dahdi_assign_span(s, 0, 0, 1);
+ if (ret)
+ dahdi_sysfs_unregister_device(ddev);
+
return ret;
}