Skip to content

Commit

Permalink
[SCSI] aha152x: Close narrow race in release
Browse files Browse the repository at this point in the history
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 <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Matthew Wilcox authored and James Bottomley committed Oct 12, 2007
1 parent dffe807 commit 1bd4057
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/aha152x.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,10 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)

void aha152x_release(struct Scsi_Host *shpnt)
{
if(!shpnt)
if (!shpnt)
return;

scsi_remove_host(shpnt);
if (shpnt->irq)
free_irq(shpnt->irq, shpnt);

Expand All @@ -923,7 +924,6 @@ void aha152x_release(struct Scsi_Host *shpnt)
pnp_device_detach(HOSTDATA(shpnt)->pnpdev);
#endif

scsi_remove_host(shpnt);
list_del(&HOSTDATA(shpnt)->host_list);
scsi_host_put(shpnt);
}
Expand Down

0 comments on commit 1bd4057

Please sign in to comment.