diff options
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r-- | drivers/scsi/hosts.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 9a10b4335e76..f5d3fbb55717 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -268,6 +268,7 @@ static void scsi_host_dev_release(struct device *dev) | |||
268 | } | 268 | } |
269 | 269 | ||
270 | scsi_destroy_command_freelist(shost); | 270 | scsi_destroy_command_freelist(shost); |
271 | scsi_destroy_command_sense_buffer(shost); | ||
271 | if (shost->bqt) | 272 | if (shost->bqt) |
272 | blk_free_tags(shost->bqt); | 273 | blk_free_tags(shost->bqt); |
273 | 274 | ||
@@ -372,10 +373,14 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) | |||
372 | else | 373 | else |
373 | shost->dma_boundary = 0xffffffff; | 374 | shost->dma_boundary = 0xffffffff; |
374 | 375 | ||
375 | rval = scsi_setup_command_freelist(shost); | 376 | rval = scsi_setup_command_sense_buffer(shost); |
376 | if (rval) | 377 | if (rval) |
377 | goto fail_kfree; | 378 | goto fail_kfree; |
378 | 379 | ||
380 | rval = scsi_setup_command_freelist(shost); | ||
381 | if (rval) | ||
382 | goto fail_destroy_sense; | ||
383 | |||
379 | device_initialize(&shost->shost_gendev); | 384 | device_initialize(&shost->shost_gendev); |
380 | snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", | 385 | snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", |
381 | shost->host_no); | 386 | shost->host_no); |
@@ -399,6 +404,8 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) | |||
399 | 404 | ||
400 | fail_destroy_freelist: | 405 | fail_destroy_freelist: |
401 | scsi_destroy_command_freelist(shost); | 406 | scsi_destroy_command_freelist(shost); |
407 | fail_destroy_sense: | ||
408 | scsi_destroy_command_sense_buffer(shost); | ||
402 | fail_kfree: | 409 | fail_kfree: |
403 | kfree(shost); | 410 | kfree(shost); |
404 | return NULL; | 411 | return NULL; |