@@ -303,7 +303,7 @@ static int vesafb_probe(struct platform_device *dev)
info->apertures = alloc_apertures(1);
if (!info->apertures) {
err = -ENOMEM;
- goto err;
+ goto release_framebuffer;
}
info->apertures->ranges[0].base = screen_info.lfb_base;
info->apertures->ranges[0].size = size_total;
@@ -462,7 +462,7 @@ static int vesafb_probe(struct platform_device *dev)
"vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
vesafb_fix.smem_len, vesafb_fix.smem_start);
err = -EIO;
- goto err;
+ goto release_framebuffer;
}
printk(KERN_INFO "vesafb: framebuffer at 0x%lx, mapped to 0x%p, "
@@ -492,6 +492,7 @@ static int vesafb_probe(struct platform_device *dev)
return 0;
err:
iounmap(info->screen_base);
+release_framebuffer:
framebuffer_release(info);
release_mem_region(vesafb_fix.smem_start, size_total);
return err;