xen, fbfront: fix connecting to backend
[pandora-kernel.git] / drivers / video / fbsysfs.c
index 67afa9c..303fb9f 100644 (file)
@@ -175,6 +175,8 @@ static ssize_t store_modes(struct device *device,
        if (i * sizeof(struct fb_videomode) != count)
                return -EINVAL;
 
+       if (!lock_fb_info(fb_info))
+               return -ENODEV;
        console_lock();
        list_splice(&fb_info->modelist, &old_list);
        fb_videomode_to_modelist((const struct fb_videomode *)buf, i,
@@ -186,6 +188,7 @@ static ssize_t store_modes(struct device *device,
                fb_destroy_modelist(&old_list);
 
        console_unlock();
+       unlock_fb_info(fb_info);
 
        return 0;
 }