Skip to content

Commit

Permalink
[SCSI] qla2xxx: only free_irq() after request_irq() succeeds
Browse files Browse the repository at this point in the history
If qla2x00_probe_one() fails before calling request_irq() but gets to
qla2x00_free_device() then it will mistakenly try to free an irq it didn't
request.  It's chosing to free based on ha->pdev->irq which is always set.

host->irq is set after request_irq() succeeds so let's use that to decide
to free or not.

This was observed and tested when a silly set of circumstances lead to
firmware loading failing on a 2100.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Zach Brown authored and James Bottomley committed Apr 20, 2006
1 parent 1a34456 commit 77347ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -1700,8 +1700,8 @@ qla2x00_free_device(scsi_qla_host_t *ha)
ha->flags.online = 0;

/* Detach interrupts */
if (ha->pdev->irq)
free_irq(ha->pdev->irq, ha);
if (ha->host->irq)
free_irq(ha->host->irq, ha);

/* release io space registers */
if (ha->iobase)
Expand Down

0 comments on commit 77347ff

Please sign in to comment.