Commit 0ccf85cf authored by François Romieu's avatar François Romieu Committed by Linus Torvalds

[PATCH] Fix error path in kahlua driver

Memory leak fix: hw_config is allocated before the call to sb_dsp_detect.
parent 051063b5
...@@ -159,7 +159,7 @@ static int __devinit probe_one(struct pci_dev *pdev, const struct pci_device_id ...@@ -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) if(sb_dsp_detect(hw_config, 0, 0, NULL)==0)
{ {
printk(KERN_ERR "kahlua: audio not responding.\n"); printk(KERN_ERR "kahlua: audio not responding.\n");
return 1; goto err_out_free;
} }
oldquiet = sb_be_quiet; oldquiet = sb_be_quiet;
...@@ -167,13 +167,16 @@ static int __devinit probe_one(struct pci_dev *pdev, const struct pci_device_id ...@@ -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)) if(sb_dsp_init(hw_config, THIS_MODULE))
{ {
sb_be_quiet = oldquiet; sb_be_quiet = oldquiet;
pci_set_drvdata(pdev, NULL); goto err_out_free;
kfree(hw_config);
return 1;
} }
sb_be_quiet = oldquiet; sb_be_quiet = oldquiet;
return 0; return 0;
err_out_free:
pci_set_drvdata(pdev, NULL);
kfree(hw_config);
return 1;
} }
static void __devexit remove_one(struct pci_dev *pdev) static void __devexit remove_one(struct pci_dev *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment