patch-2.4.4 linux/drivers/video/vga16fb.c

Next file: linux/fs/Config.in
Previous file: linux/drivers/video/vesafb.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.3/linux/drivers/video/vga16fb.c linux/drivers/video/vga16fb.c
@@ -897,6 +897,10 @@
 	/* XXX share VGA_FB_PHYS region with vgacon */
 
         vga16fb.video_vbase = ioremap(VGA_FB_PHYS, VGA_FB_PHYS_LEN);
+	if (!vga16fb.video_vbase) {
+		printk(KERN_ERR "vga16fb: unable to map device\n");
+		return -ENOMEM;
+	}
 	printk(KERN_INFO "vga16fb: mapped to 0x%p\n", vga16fb.video_vbase);
 
 	vga16fb.isVGA = ORIG_VIDEO_ISVGA;
@@ -931,8 +935,10 @@
 	vga16fb.fb_info.flags=FBINFO_FLAG_DEFAULT;
 	vga16fb_set_disp(-1, &vga16fb);
 
-	if (register_framebuffer(&vga16fb.fb_info)<0)
+	if (register_framebuffer(&vga16fb.fb_info)<0) {
+		iounmap(vga16fb.video_vbase);
 		return -EINVAL;
+	}
 
 	printk(KERN_INFO "fb%d: %s frame buffer device\n",
 	       GET_FB_IDX(vga16fb.fb_info.node), vga16fb.fb_info.modename);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)