Commit e9589567 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] janitor: vgastate: cleanup iounmap() usage

From: "Randy.Dunlap" <rddunlap@osdl.org>

From: Leann Ogasawara <ogasawara@osdl.org>

Patch inserts missing iounmap's on error and also removes unnecessary
iounmap's.
parent 9f33cf76
......@@ -420,7 +420,6 @@ int save_vga(struct vgastate *state)
if (!fbbase) {
vga_cleanup(state);
iounmap(fbbase);
return 1;
}
......@@ -430,6 +429,7 @@ int save_vga(struct vgastate *state)
if (state->flags & VGA_SAVE_FONT0) {
saved->vga_font0 = vmalloc(4 * 8192);
if (!saved->vga_font0) {
iounmap(fbbase);
vga_cleanup(state);
return 1;
}
......@@ -441,6 +441,7 @@ int save_vga(struct vgastate *state)
if (state->flags & VGA_SAVE_FONT1) {
saved->vga_font1 = vmalloc(state->memsize);
if (!saved->vga_font1) {
iounmap(fbbase);
vga_cleanup(state);
return 1;
}
......@@ -451,6 +452,7 @@ int save_vga(struct vgastate *state)
if (state->flags & VGA_SAVE_TEXT) {
saved->vga_text = vmalloc(8192 * 2);
if (!saved->vga_text) {
iounmap(fbbase);
vga_cleanup(state);
return 1;
}
......@@ -475,7 +477,6 @@ int restore_vga (struct vgastate *state)
if (!fbbase) {
vga_cleanup(state);
iounmap(fbbase);
return 1;
}
restore_vga_text(state, fbbase);
......
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