Skip to content

Commit

Permalink
[SCSI] ibmvstgt: set up scsi_host properly before __scsi_alloc_queue
Browse files Browse the repository at this point in the history
Before calling __scsi_alloc_queue, scsi_host->shost_gendev.parent must
be initialized properly.

This patch moves __scsi_alloc_queue after scsi_add_host (like
initiator drivers do).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Mar 3, 2008
1 parent ab3b0be commit b560665
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/scsi/ibmvscsi/ibmvstgt.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,9 +838,6 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)
if (!shost)
goto free_vport;
shost->transportt = ibmvstgt_transport_template;
err = scsi_tgt_alloc_queue(shost);
if (err)
goto put_host;

target = host_to_srp_target(shost);
target->shost = shost;
Expand Down Expand Up @@ -872,6 +869,10 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)
if (err)
goto destroy_queue;

err = scsi_tgt_alloc_queue(shost);
if (err)
goto destroy_queue;

return 0;
destroy_queue:
crq_queue_destroy(target);
Expand Down

0 comments on commit b560665

Please sign in to comment.