summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdc
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-10-22 19:01:10 +0000
committerphk <phk@FreeBSD.org>2004-10-22 19:01:10 +0000
commit976462622a7aaec6c473905747b400a314ad76bb (patch)
tree6cee3c807ff539b06807a7fb5d696e721533d056 /sys/dev/fdc
parentaddc11daafb88d6e32940aa5bda4c2b473381480 (diff)
downloadFreeBSD-src-976462622a7aaec6c473905747b400a314ad76bb.zip
FreeBSD-src-976462622a7aaec6c473905747b400a314ad76bb.tar.gz
Properly handle failure to allocate isadma bounce buffer
Diffstat (limited to 'sys/dev/fdc')
-rw-r--r--sys/dev/fdc/fdc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index ecbc850..0d44423 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -1723,10 +1723,14 @@ fdc_attach(device_t dev)
}
if (!(fdc->flags & FDC_NODMA)) {
error = isa_dma_acquire(fdc->dmachan);
+ if (!error) {
+ error = isa_dma_init(fdc->dmachan,
+ MAX_BYTES_PER_CYL, M_WAITOK);
+ if (error)
+ isa_dma_release(fdc->dmachan);
+ }
if (error)
return (error);
- /* XXX no error return */
- isa_dmainit(fdc->dmachan, MAX_BYTES_PER_CYL);
}
fdc->fdcu = device_get_unit(dev);
fdc->flags |= FDC_NEEDS_RESET;
OpenPOWER on IntegriCloud