diff options
-rw-r--r-- | drivers/scsi/hosts.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 4e811ca3270e..3690360d7a79 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -199,9 +199,13 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev) | |||
199 | if (!shost->can_queue) { | 199 | if (!shost->can_queue) { |
200 | printk(KERN_ERR "%s: can_queue = 0 no longer supported\n", | 200 | printk(KERN_ERR "%s: can_queue = 0 no longer supported\n", |
201 | sht->name); | 201 | sht->name); |
202 | goto out; | 202 | goto fail; |
203 | } | 203 | } |
204 | 204 | ||
205 | error = scsi_setup_command_freelist(shost); | ||
206 | if (error) | ||
207 | goto fail; | ||
208 | |||
205 | if (!shost->shost_gendev.parent) | 209 | if (!shost->shost_gendev.parent) |
206 | shost->shost_gendev.parent = dev ? dev : &platform_bus; | 210 | shost->shost_gendev.parent = dev ? dev : &platform_bus; |
207 | 211 | ||
@@ -255,6 +259,8 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev) | |||
255 | out_del_gendev: | 259 | out_del_gendev: |
256 | device_del(&shost->shost_gendev); | 260 | device_del(&shost->shost_gendev); |
257 | out: | 261 | out: |
262 | scsi_destroy_command_freelist(shost); | ||
263 | fail: | ||
258 | return error; | 264 | return error; |
259 | } | 265 | } |
260 | EXPORT_SYMBOL(scsi_add_host); | 266 | EXPORT_SYMBOL(scsi_add_host); |
@@ -381,10 +387,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) | |||
381 | else | 387 | else |
382 | shost->dma_boundary = 0xffffffff; | 388 | shost->dma_boundary = 0xffffffff; |
383 | 389 | ||
384 | rval = scsi_setup_command_freelist(shost); | ||
385 | if (rval) | ||
386 | goto fail_kfree; | ||
387 | |||
388 | device_initialize(&shost->shost_gendev); | 390 | device_initialize(&shost->shost_gendev); |
389 | snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", | 391 | snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", |
390 | shost->host_no); | 392 | shost->host_no); |
@@ -404,14 +406,12 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) | |||
404 | "scsi_eh_%d", shost->host_no); | 406 | "scsi_eh_%d", shost->host_no); |
405 | if (IS_ERR(shost->ehandler)) { | 407 | if (IS_ERR(shost->ehandler)) { |
406 | rval = PTR_ERR(shost->ehandler); | 408 | rval = PTR_ERR(shost->ehandler); |
407 | goto fail_destroy_freelist; | 409 | goto fail_kfree; |
408 | } | 410 | } |
409 | 411 | ||
410 | scsi_proc_hostdir_add(shost->hostt); | 412 | scsi_proc_hostdir_add(shost->hostt); |
411 | return shost; | 413 | return shost; |
412 | 414 | ||
413 | fail_destroy_freelist: | ||
414 | scsi_destroy_command_freelist(shost); | ||
415 | fail_kfree: | 415 | fail_kfree: |
416 | kfree(shost); | 416 | kfree(shost); |
417 | return NULL; | 417 | return NULL; |