aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fdc
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-10-22 19:01:10 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-10-22 19:01:10 +0000
commit1ef0fd822480736c7431f46463eb5ab10eb436d7 (patch)
tree6cee3c807ff539b06807a7fb5d696e721533d056 /sys/dev/fdc
parentcc62efa5276bb1ca0534814559e2beec1a376c43 (diff)
downloadsrc-1ef0fd822480736c7431f46463eb5ab10eb436d7.tar.gz
src-1ef0fd822480736c7431f46463eb5ab10eb436d7.zip
Properly handle failure to allocate isadma bounce buffer
Notes
Notes: svn path=/head/; revision=136787
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 ecbc85032c54..0d44423e9319 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;