From: Matthew Wilcox Date: Wed, 15 Aug 2007 18:57:00 +0000 (-0600) Subject: [SCSI] ips: Close narrow race in release X-Git-Tag: v2.6.24-rc1~1290^2~66 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a50ee7a72888d072512e4434c44959743bfb1570;p=linux-2.6 [SCSI] ips: Close narrow race in release We were releasing the IRQ before removing the host, so commands could still be coming in which would never be seen by the interrupt handler. Just remove the host before releasing the IRQ to close this race. Signed-off-by: Matthew Wilcox Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index b17771b1c6..36b6765943 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -656,6 +656,8 @@ ips_release(struct Scsi_Host *sh) METHOD_TRACE("ips_release", 1); + scsi_remove_host(sh); + for (i = 0; i < IPS_MAX_ADAPTERS && ips_sh[i] != sh; i++) ; if (i == IPS_MAX_ADAPTERS) { @@ -707,7 +709,6 @@ ips_release(struct Scsi_Host *sh) /* free IRQ */ free_irq(ha->irq, ha); - scsi_remove_host(sh); scsi_host_put(sh); ips_released_controllers++;