Dont call dma->free unless dma is there.

Spotted by: Ian Dowse <iedowse@maths.tcd.ie>
This commit is contained in:
Søren Schmidt 2003-03-13 09:04:55 +00:00
parent a80cc4e104
commit 394046e66f

View File

@ -148,7 +148,8 @@ atapi_detach(struct ata_device *atadev)
}
free(request, M_ATAPI);
}
atadev->channel->dma->free(atadev);
if (atadev->channel->dma)
atadev->channel->dma->free(atadev);
free(atadev->result, M_ATAPI);
atadev->driver = NULL;
atadev->flags = 0;