Skip to contentSkip to conversation

video: fix deferred io fsync()

PATCH In review Magnus Damm 2 participants 2 messages Dec 17, 2008 – Dec 24, 2008 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: fix deferred io fsync()

From: Magnus Damm <[email protected]>

If CONFIG_FB_DEFERRED_IO is set, but there are framebuffers registered that does not make use of deferred io, then fsync() on those framebuffers will result in a crash. Fix that.

---

 drivers/video/fb_defio.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/video/fb_defio.c +4 -0
@@ -60,6 +60,10 @@ int fb_deferred_io_fsync(struct file *fi
 {
 	struct fb_info *info = file->private_data;
 
+	/* Skip if deferred io is complied-in but disabled on this fbdev */
+	if (!info->fbdefio)
+		return 0;
+
 	/* Kill off the delayed work */
 	cancel_rearming_delayed_work(&info->deferred_work);
 

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/