]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/ext2/ioctl.c
ext2: return error when fail to allocating memory in ioctl
[linux.git] / fs / ext2 / ioctl.c
index 1b853fb0b1639f6fb123954326bc886606a6be01..32a8d10b579df71a75ee13b645ece202e167d908 100644 (file)
@@ -145,10 +145,13 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                if (ei->i_block_alloc_info){
                        struct ext2_reserve_window_node *rsv = &ei->i_block_alloc_info->rsv_window_node;
                        rsv->rsv_goal_size = rsv_window_size;
+               } else {
+                       ret = -ENOMEM;
                }
+
                mutex_unlock(&ei->truncate_mutex);
                mnt_drop_write_file(filp);
-               return 0;
+               return ret;
        }
        default:
                return -ENOTTY;