Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Andrew Morton and committed by
Linus Torvalds
444d1d9b 0db9ae4a

+2 -1
+2 -1
drivers/scsi/qla2xxx/qla_os.c
··· 1325 1325 ha->brd_info = brd_info; 1326 1326 sprintf(ha->host_str, "%s_%ld", ha->brd_info->drv_name, ha->host_no); 1327 1327 1328 + ha->dpc_pid = -1; 1329 + 1328 1330 /* Configure PCI I/O space */ 1329 1331 ret = qla2x00_iospace_config(ha); 1330 1332 if (ret) ··· 1450 1448 */ 1451 1449 spin_lock_init(&ha->mbx_reg_lock); 1452 1450 1453 - ha->dpc_pid = -1; 1454 1451 init_completion(&ha->dpc_inited); 1455 1452 init_completion(&ha->dpc_exited); 1456 1453