drm/bridge: dw_hdmi: clear ih_mute register when system resume
[firefly-linux-kernel-4.4.55.git] / mm / shmem.c
index b82e56ebabdd6ed7e1f270d504d80e7e8fa24811..79997e8cf807c54b8a8217df6f9b70ef9f4e981f 100644 (file)
@@ -2153,9 +2153,11 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset,
                                                                        NULL);
                if (error) {
                        /* Remove the !PageUptodate pages we added */
-                       shmem_undo_range(inode,
-                               (loff_t)start << PAGE_CACHE_SHIFT,
-                               (loff_t)index << PAGE_CACHE_SHIFT, true);
+                       if (index > start) {
+                               shmem_undo_range(inode,
+                                (loff_t)start << PAGE_CACHE_SHIFT,
+                                ((loff_t)index << PAGE_CACHE_SHIFT) - 1, true);
+                       }
                        goto undone;
                }