Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc5d8ac0 authored by Krzysztof Helt's avatar Krzysztof Helt Committed by Linus Torvalds
Browse files

cirrusfb: fix error paths in cirrusfb_xxx_register()



Balance iomap and iounmap and alloc and free calls in case of error druing
device register (probing).

Signed-off-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9e848062
Loading
Loading
Loading
Loading
+7 −12
Original line number Original line Diff line number Diff line
@@ -2090,8 +2090,6 @@ static int __devinit cirrusfb_register(struct fb_info *info)


err_dealloc_cmap:
err_dealloc_cmap:
	fb_dealloc_cmap(&info->cmap);
	fb_dealloc_cmap(&info->cmap);
	cinfo->unmap(info);
	framebuffer_release(info);
	return err;
	return err;
}
}


@@ -2328,17 +2326,14 @@ static int __devinit cirrusfb_zorro_register(struct zorro_dev *z,
	zorro_set_drvdata(z, info);
	zorro_set_drvdata(z, info);


	ret = cirrusfb_register(info);
	ret = cirrusfb_register(info);
	if (ret) {
	if (!ret)
		if (btype == BT_PICASSO4) {
		return 0;
			iounmap(info->screen_base);

			iounmap(cinfo->regbase - 0x600000);
	if (btype == BT_PICASSO4 || board_addr > 0x01000000)
		} else if (board_addr > 0x01000000)
		iounmap(info->screen_base);
		iounmap(info->screen_base);
	}
	return ret;


err_unmap_regbase:
err_unmap_regbase:
	/* Parental advisory: explicit hack */
	if (btype == BT_PICASSO4)
		iounmap(cinfo->regbase - 0x600000);
		iounmap(cinfo->regbase - 0x600000);
err_release_region:
err_release_region:
	release_region(board_addr, board_size);
	release_region(board_addr, board_size);