diff options
author | Sebastian Siewior <frame+buffer@ml.breakpoint.cc> | 2008-04-28 05:15:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:41 -0400 |
commit | 2422fbba0684ddf08898ec2f3cf23cb16a54b3f5 (patch) | |
tree | 97137da905136ce092c288a98f247e8ac2e6271c /drivers | |
parent | 03c33a4f002b2521debf1efc269cade983b6e86a (diff) |
metronomefb: don't free firmware twice in error path
Right now, if request_irq or anthing after it fails than we free the firmware
for the second time what might end bad :)
Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Acked-by: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/metronomefb.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c index 17066dd5a190..249791286367 100644 --- a/drivers/video/metronomefb.c +++ b/drivers/video/metronomefb.c | |||
@@ -671,14 +671,14 @@ static int __devinit metronomefb_probe(struct platform_device *dev) | |||
671 | 671 | ||
672 | retval = load_waveform((u8 *) fw_entry->data, fw_entry->size, | 672 | retval = load_waveform((u8 *) fw_entry->data, fw_entry->size, |
673 | par->metromem_wfm, 3, 31, &par->frame_count); | 673 | par->metromem_wfm, 3, 31, &par->frame_count); |
674 | release_firmware(fw_entry); | ||
674 | if (retval < 0) { | 675 | if (retval < 0) { |
675 | printk(KERN_ERR "metronomefb: couldn't process waveform\n"); | 676 | printk(KERN_ERR "metronomefb: couldn't process waveform\n"); |
676 | goto err_ld_wfm; | 677 | goto err_dma_free; |
677 | } | 678 | } |
678 | release_firmware(fw_entry); | ||
679 | 679 | ||
680 | if (board->setup_irq(info)) | 680 | if (board->setup_irq(info)) |
681 | goto err_ld_wfm; | 681 | goto err_dma_free; |
682 | 682 | ||
683 | retval = metronome_init_regs(par); | 683 | retval = metronome_init_regs(par); |
684 | if (retval < 0) | 684 | if (retval < 0) |
@@ -719,8 +719,6 @@ err_fb_rel: | |||
719 | framebuffer_release(info); | 719 | framebuffer_release(info); |
720 | err_free_irq: | 720 | err_free_irq: |
721 | board->free_irq(info); | 721 | board->free_irq(info); |
722 | err_ld_wfm: | ||
723 | release_firmware(fw_entry); | ||
724 | err_dma_free: | 722 | err_dma_free: |
725 | dma_free_writecombine(&dev->dev, par->metromemsize, par->metromem, | 723 | dma_free_writecombine(&dev->dev, par->metromemsize, par->metromem, |
726 | par->metromem_dma); | 724 | par->metromem_dma); |