From: JieJing.Zhang <kzjeef@xxxxxxxxx> Signed-off-by: JieJing.Zhang <kzjeef@xxxxxxxxx> --- fs/btrfs/file.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index e354c33..caa9e3f 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -926,6 +926,10 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb, PAGE_CACHE_SIZE, PAGE_CACHE_SIZE / (sizeof(struct page *))); pages = kmalloc(nrptrs * sizeof(struct page *), GFP_KERNEL); + if (unlikely(!pages)) { + ret = -ENOMEM; + goto out; + } /* generic_write_checks can change our pos */ start_pos = pos; -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html