scst_main: Fix up the error handling

We should clear sysfs during copy manager device registration failure.
Otherwise, we will not be able to re-register this device, since the
sysfs for it has already been created.
This commit is contained in:
Gleb Chesnokov
2022-07-23 18:39:21 +03:00
parent 4a02996629
commit 1db47d2a3e

View File

@@ -1356,8 +1356,10 @@ int scst_register_virtual_device_node(struct scst_dev_type *dev_handler,
list_add_tail(&dev->dev_list_entry, &scst_dev_list);
res = scst_cm_on_dev_register(dev);
if (res != 0)
if (res != 0) {
sysfs_del = true;
goto out_unreg;
}
mutex_unlock(&scst_mutex);