Commit 444d1d9b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] qlogic lockup fix

If qla2x00_probe_one()'s call to qla2x00_iospace_config() fails, we call
qla2x00_free_device() to clean up.  But because ha->dpc_pid hasn't been set
yet, qla2x00_free_device() tries to stop a kernel thread which hasn't started
yet.  It does wait_for_completion() against an uninitialised completion struct
and the kernel hangs up.

Fix it by initialising ha->dpc_pid a bit earlier.

Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0db9ae4a
...@@ -1325,6 +1325,8 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info) ...@@ -1325,6 +1325,8 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
ha->brd_info = brd_info; ha->brd_info = brd_info;
sprintf(ha->host_str, "%s_%ld", ha->brd_info->drv_name, ha->host_no); sprintf(ha->host_str, "%s_%ld", ha->brd_info->drv_name, ha->host_no);
ha->dpc_pid = -1;
/* Configure PCI I/O space */ /* Configure PCI I/O space */
ret = qla2x00_iospace_config(ha); ret = qla2x00_iospace_config(ha);
if (ret) if (ret)
...@@ -1448,7 +1450,6 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info) ...@@ -1448,7 +1450,6 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
*/ */
spin_lock_init(&ha->mbx_reg_lock); spin_lock_init(&ha->mbx_reg_lock);
ha->dpc_pid = -1;
init_completion(&ha->dpc_inited); init_completion(&ha->dpc_inited);
init_completion(&ha->dpc_exited); init_completion(&ha->dpc_exited);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment