diff options
author | imp <imp@FreeBSD.org> | 2005-03-15 08:02:47 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-03-15 08:02:47 +0000 |
commit | a7b3bd456408d157545ff8c8ffd7060ae2070886 (patch) | |
tree | ef49c4f92a36a70322db975ec33f0e6d232f32c6 /sys/dev/fdc/fdc_isa.c | |
parent | f6d2d1ffc3bad9fc7860fe1305b6ded4a28597c8 (diff) | |
download | FreeBSD-src-a7b3bd456408d157545ff8c8ffd7060ae2070886.zip FreeBSD-src-a7b3bd456408d157545ff8c8ffd7060ae2070886.tar.gz |
If we fail a sanity check for the resources just allocated, make sure
that we free that resource. All the other resources are freed in
their own routine, but since we haven't saved a pointer to this one,
it is leaked. This is the failure case that lead to the sio ports
that weren't working, I think.
Diffstat (limited to 'sys/dev/fdc/fdc_isa.c')
-rw-r--r-- | sys/dev/fdc/fdc_isa.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/fdc/fdc_isa.c b/sys/dev/fdc/fdc_isa.c index 68fee40..ab7057d 100644 --- a/sys/dev/fdc/fdc_isa.c +++ b/sys/dev/fdc/fdc_isa.c @@ -98,8 +98,10 @@ fdc_isa_alloc_resources(device_t dev, struct fdc_data *fdc) * check resource ranges. */ i = rman_get_start(res) & 0x7; - if (i + rman_get_size(res) - 1 > FDC_MAXREG) + if (i + rman_get_size(res) - 1 > FDC_MAXREG) { + bus_release_resource(dev, SYS_RES_IOPORT, newrid, res); return (ENXIO); + } for (j = 0; j < rman_get_size(res); j++) { fdc->resio[i + j] = res; fdc->ridio[i + j] = newrid; |