Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93929
b: refs/heads/master
c: 542bd13
h: refs/heads/master
i:
  93927: 1f44637
v: v3
  • Loading branch information
James Bottomley authored and James Bottomley committed Apr 27, 2008
1 parent 4433a8e commit 13025aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 582fb6c03a0e89d05e4efa8a3e4bd09d0942dadc
refs/heads/master: 542bd1377a963070bc4a03ff7d2690ddf3920596
16 changes: 8 additions & 8 deletions trunk/drivers/scsi/hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,13 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
if (!shost->can_queue) {
printk(KERN_ERR "%s: can_queue = 0 no longer supported\n",
sht->name);
goto out;
goto fail;
}

error = scsi_setup_command_freelist(shost);
if (error)
goto fail;

if (!shost->shost_gendev.parent)
shost->shost_gendev.parent = dev ? dev : &platform_bus;

Expand Down Expand Up @@ -255,6 +259,8 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
out_del_gendev:
device_del(&shost->shost_gendev);
out:
scsi_destroy_command_freelist(shost);
fail:
return error;
}
EXPORT_SYMBOL(scsi_add_host);
Expand Down Expand Up @@ -381,10 +387,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
else
shost->dma_boundary = 0xffffffff;

rval = scsi_setup_command_freelist(shost);
if (rval)
goto fail_kfree;

device_initialize(&shost->shost_gendev);
snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d",
shost->host_no);
Expand All @@ -404,14 +406,12 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
"scsi_eh_%d", shost->host_no);
if (IS_ERR(shost->ehandler)) {
rval = PTR_ERR(shost->ehandler);
goto fail_destroy_freelist;
goto fail_kfree;
}

scsi_proc_hostdir_add(shost->hostt);
return shost;

fail_destroy_freelist:
scsi_destroy_command_freelist(shost);
fail_kfree:
kfree(shost);
return NULL;
Expand Down

0 comments on commit 13025aa

Please sign in to comment.