Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965122AbbLOMHH (ORCPT ); Tue, 15 Dec 2015 07:07:07 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:32809 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965034AbbLOMHF (ORCPT ); Tue, 15 Dec 2015 07:07:05 -0500 From: Javier Gonzalez To: m@bjorling.me Cc: javier@javigon.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Javier Gonzalez Subject: [PATCH] lightnvm: add check after mempool allocation Date: Tue, 15 Dec 2015 13:06:35 +0100 Message-Id: <1450181195-24702-1-git-send-email-javier@javigon.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 870 Lines: 28 Add missing check after mempool allocation. Signed-off-by: Javier Gonzalez --- drivers/lightnvm/rrpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index a1e7488..f4bc986 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -287,6 +287,8 @@ static int rrpc_move_valid_pages(struct rrpc *rrpc, struct rrpc_block *rblk) } page = mempool_alloc(rrpc->page_pool, GFP_NOIO); + if (!page) + return -ENOMEM; while ((slot = find_first_zero_bit(rblk->invalid_pages, nr_pgs_per_blk)) < nr_pgs_per_blk) { -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/