Skip to content

Commit

Permalink
video: fix deferred io fsync()
Browse files Browse the repository at this point in the history
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.

This is needed for sh_mobile_lcdcfb since we always enable
deferred io at compile time but we may disable deferred io
for some types of hardware configurations.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Jaya Kumar <jayakumar.lkml@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Dec 22, 2008
1 parent 0790555 commit 87884bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/video/fb_defio.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int datasync)
{
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);

Expand Down

0 comments on commit 87884bd

Please sign in to comment.