summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrançois Romieu <romieu@fr.zoreil.com>2003-07-18 03:15:26 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-07-18 03:15:26 -0700
commit0ccf85cffb3f95e787dffca59aeef046ad285a2d (patch)
treec238cc4dceaa02b69c8d352db6858860426e7cb1
parent051063b55f000f3e6d3915e6aa37f40b9eb0d619 (diff)
[PATCH] Fix error path in kahlua driver
Memory leak fix: hw_config is allocated before the call to sb_dsp_detect.
-rw-r--r--sound/oss/kahlua.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c
index 94786206ffae..f8b37cb88116 100644
--- a/sound/oss/kahlua.c
+++ b/sound/oss/kahlua.c
@@ -159,7 +159,7 @@ static int __devinit probe_one(struct pci_dev *pdev, const struct pci_device_id
if(sb_dsp_detect(hw_config, 0, 0, NULL)==0)
{
printk(KERN_ERR "kahlua: audio not responding.\n");
- return 1;
+ goto err_out_free;
}
oldquiet = sb_be_quiet;
@@ -167,13 +167,16 @@ static int __devinit probe_one(struct pci_dev *pdev, const struct pci_device_id
if(sb_dsp_init(hw_config, THIS_MODULE))
{
sb_be_quiet = oldquiet;
- pci_set_drvdata(pdev, NULL);
- kfree(hw_config);
- return 1;
+ goto err_out_free;
}
sb_be_quiet = oldquiet;
return 0;
+
+err_out_free:
+ pci_set_drvdata(pdev, NULL);
+ kfree(hw_config);
+ return 1;
}
static void __devexit remove_one(struct pci_dev *pdev)