sdiahci: prevent nil pointer dereference on spurious interrupt status

on some controllers, we get bogus interrupt indication
for non present drives. ack the irq but ignore.
This commit is contained in:
cinap_lenrek 2013-02-22 12:23:01 +01:00
parent 56d9f57dc8
commit f5ff6d6f34

View file

@ -1201,7 +1201,7 @@ iainterrupt(Ureg *u, void *a)
cause &= ~m;
d = c->rawdrive + i;
ilock(d);
if(d->port->isr && c->hba->pi & m)
if(d->port != nil && d->port->isr && c->hba->pi & m)
updatedrive(d);
c->hba->isr = m;
iunlock(d);