From: Sebastian Siewior Date: Mon, 28 Apr 2008 09:15:39 +0000 (-0700) Subject: metronomefb: don't free firmware twice in error path X-Git-Tag: v2.6.26-rc1~784 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=2422fbba0684ddf08898ec2f3cf23cb16a54b3f5;p=linux-2.6-omap-h63xx.git 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 Acked-by: Jaya Kumar Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c index 17066dd5a19..24979128636 100644 --- a/drivers/video/metronomefb.c +++ b/drivers/video/metronomefb.c @@ -671,14 +671,14 @@ static int __devinit metronomefb_probe(struct platform_device *dev) retval = load_waveform((u8 *) fw_entry->data, fw_entry->size, par->metromem_wfm, 3, 31, &par->frame_count); + release_firmware(fw_entry); if (retval < 0) { printk(KERN_ERR "metronomefb: couldn't process waveform\n"); - goto err_ld_wfm; + goto err_dma_free; } - release_firmware(fw_entry); if (board->setup_irq(info)) - goto err_ld_wfm; + goto err_dma_free; retval = metronome_init_regs(par); if (retval < 0) @@ -719,8 +719,6 @@ err_fb_rel: framebuffer_release(info); err_free_irq: board->free_irq(info); -err_ld_wfm: - release_firmware(fw_entry); err_dma_free: dma_free_writecombine(&dev->dev, par->metromemsize, par->metromem, par->metromem_dma);