Commit 77cca462 authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] hosts.c: fixes for "no error" reported after error scenarios

This patch corrects some cases in scsi_add_host() that fail, but the "error"
return code was not reset after a prior use which set it to a non-error value.

Patch cut against scsi-rc-fixes-2.6
Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 0feed274
...@@ -218,19 +218,25 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev) ...@@ -218,19 +218,25 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
get_device(&shost->shost_gendev); get_device(&shost->shost_gendev);
if (shost->transportt->host_size && if (shost->transportt->host_size) {
(shost->shost_data = kzalloc(shost->transportt->host_size, shost->shost_data = kzalloc(shost->transportt->host_size,
GFP_KERNEL)) == NULL) GFP_KERNEL);
if (shost->shost_data == NULL) {
error = -ENOMEM;
goto out_del_classdev; goto out_del_classdev;
}
}
if (shost->transportt->create_work_queue) { if (shost->transportt->create_work_queue) {
snprintf(shost->work_q_name, KOBJ_NAME_LEN, "scsi_wq_%d", snprintf(shost->work_q_name, KOBJ_NAME_LEN, "scsi_wq_%d",
shost->host_no); shost->host_no);
shost->work_q = create_singlethread_workqueue( shost->work_q = create_singlethread_workqueue(
shost->work_q_name); shost->work_q_name);
if (!shost->work_q) if (!shost->work_q) {
error = -EINVAL;
goto out_free_shost_data; goto out_free_shost_data;
} }
}
error = scsi_sysfs_add_host(shost); error = scsi_sysfs_add_host(shost);
if (error) if (error)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment