aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/aacraid/linit.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index fdfc4be9c7c6..2be612b0caa5 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -1089,8 +1089,17 @@ static struct scsi_host_template aac_driver_template = {
1089 1089
1090static void __aac_shutdown(struct aac_dev * aac) 1090static void __aac_shutdown(struct aac_dev * aac)
1091{ 1091{
1092 if (aac->aif_thread) 1092 if (aac->aif_thread) {
1093 int i;
1094 /* Clear out events first */
1095 for (i = 0; i < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); i++) {
1096 struct fib *fib = &aac->fibs[i];
1097 if (!(fib->hw_fib_va->header.XferState & cpu_to_le32(NoResponseExpected | Async)) &&
1098 (fib->hw_fib_va->header.XferState & cpu_to_le32(ResponseExpected)))
1099 up(&fib->event_wait);
1100 }
1093 kthread_stop(aac->thread); 1101 kthread_stop(aac->thread);
1102 }
1094 aac_send_shutdown(aac); 1103 aac_send_shutdown(aac);
1095 aac_adapter_disable_int(aac); 1104 aac_adapter_disable_int(aac);
1096 free_irq(aac->pdev->irq, aac); 1105 free_irq(aac->pdev->irq, aac);
@@ -1191,6 +1200,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
1191 if (IS_ERR(aac->thread)) { 1200 if (IS_ERR(aac->thread)) {
1192 printk(KERN_ERR "aacraid: Unable to create command thread.\n"); 1201 printk(KERN_ERR "aacraid: Unable to create command thread.\n");
1193 error = PTR_ERR(aac->thread); 1202 error = PTR_ERR(aac->thread);
1203 aac->thread = NULL;
1194 goto out_deinit; 1204 goto out_deinit;
1195 } 1205 }
1196 1206