提交 77347ff7 编写于 作者: Z Zach Brown 提交者: James Bottomley

[SCSI] qla2xxx: only free_irq() after request_irq() succeeds

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: NZach Brown <zach.brown@oracle.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 1a34456b
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册