From b742903c986d4638edce98885810bff7e956c175 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 7 Nov 2011 22:40:15 +0000 Subject: 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 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10331 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/dahdi-base.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- cgit v1.2.3