summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Alanen <maalanen@ra.abo.fi>2002-07-14 23:11:22 -0700
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-07-14 23:11:22 -0700
commit88e91c1d7bcc3f6dcc94fdee26941b1d25e30ecd (patch)
tree2e130c0e941194edb80e1303767fa9e37c0623bb
parente805719ac50908d3b8259dce1f0bdc2cc7d2eae4 (diff)
[PATCH] [patch, 2.5] sound_oss_ad1848.c doesn't release region on error
Doesn't check request_region and doesn't release region on failed kmalloc.
-rw-r--r--sound/oss/ad1848.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c
index c778677958e8..117c9e802edc 100644
--- a/sound/oss/ad1848.c
+++ b/sound/oss/ad1848.c
@@ -1996,7 +1996,8 @@ int ad1848_init (char *name, int io_base, int irq, int dma_playback,
sprintf(dev_name,
"Generic audio codec (%s)", devc->chip_name);
- request_region(devc->base, 4, devc->name);
+ if (!request_region(devc->base, 4, devc->name))
+ return -1;
conf_printf2(dev_name, devc->base, devc->irq, dma_playback, dma_capture);
@@ -2012,8 +2013,10 @@ int ad1848_init (char *name, int io_base, int irq, int dma_playback,
}
portc = (ad1848_port_info *) kmalloc(sizeof(ad1848_port_info), GFP_KERNEL);
- if(portc==NULL)
+ if(portc==NULL) {
+ release_region(devc->base, 4);
return -1;
+ }
if ((my_dev = sound_install_audiodrv(AUDIO_DRIVER_VERSION,
dev_name,
@@ -2025,8 +2028,8 @@ int ad1848_init (char *name, int io_base, int irq, int dma_playback,
dma_playback,
dma_capture)) < 0)
{
+ release_region(devc->base, 4);
kfree(portc);
- portc=NULL;
return -1;
}