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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user