提交 57458036 编写于 作者: B Brian King 提交者: James Bottomley

[SCSI] ibmvstgt: move crq_queue_create to the end of initialization

Calling crq_queue_create could lead to the creation of a rport. We
need to set up everything before creating a rport. This moves
crq_queue_create to the end of initialization to avoid a race which
causes an oops if lost.
Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reported-by: NOlaf Hering <olh@suse.de>
Cc: stable@kernel.org
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 d3acf022
...@@ -864,21 +864,23 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id) ...@@ -864,21 +864,23 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)
INIT_WORK(&vport->crq_work, handle_crq); INIT_WORK(&vport->crq_work, handle_crq);
err = crq_queue_create(&vport->crq_queue, target); err = scsi_add_host(shost, target->dev);
if (err) if (err)
goto free_srp_target; goto free_srp_target;
err = scsi_add_host(shost, target->dev); err = scsi_tgt_alloc_queue(shost);
if (err) if (err)
goto destroy_queue; goto remove_host;
err = scsi_tgt_alloc_queue(shost); err = crq_queue_create(&vport->crq_queue, target);
if (err) if (err)
goto destroy_queue; goto free_queue;
return 0; return 0;
destroy_queue: free_queue:
crq_queue_destroy(target); scsi_tgt_free_queue(shost);
remove_host:
scsi_remove_host(shost);
free_srp_target: free_srp_target:
srp_target_free(target); srp_target_free(target);
put_host: put_host:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册