scst_assign_dev_handler(): detach if attach only succeeded partially

Partial attach failure should result in calling detach for those handlers
for which attach succeeded

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4387 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-06-28 22:35:49 +00:00
parent 2fc379e221
commit e80a15bfd3

View File

@@ -1868,7 +1868,7 @@ assign:
if (res != 0) {
PRINT_ERROR("Device handler's %s attach_tgt() "
"failed: %d", handler->name, res);
goto out_err_remove_sysfs;
goto out_err_detach_tgt;
}
list_add_tail(&tgt_dev->extra_tgt_dev_list_entry,
&attached_tgt_devs);
@@ -1894,7 +1894,6 @@ out_err_detach_tgt:
}
}
out_err_remove_sysfs:
scst_devt_dev_sysfs_del(dev);
out_detach: