From patchwork Thu Feb 4 13:57:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 8221931 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9BDA5BEEE5 for ; Thu, 4 Feb 2016 14:00:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE6802038A for ; Thu, 4 Feb 2016 13:59:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CD45F20357 for ; Thu, 4 Feb 2016 13:59:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756367AbcBDN76 (ORCPT ); Thu, 4 Feb 2016 08:59:58 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:35384 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752797AbcBDN61 (ORCPT ); Thu, 4 Feb 2016 08:58:27 -0500 Received: by mail-wm0-f41.google.com with SMTP id r129so213003700wmr.0 for ; Thu, 04 Feb 2016 05:58:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8E1/kxcThZxKT+6LoYF0qh0PTTazrjtplQcuadg916I=; b=d3IPVnzvBzwYi/iexUIwhwrWItAX2j3YHYr1riPTFnF09zIGuMJc2pdHT+cDDGeteg pF6Z2zc+pIbHfXNS4XRjkvYo2uEVxoaAfU3r/AIImhG8QHSun8zvoy8N+gXl0T1Q5bEK 0fqoZgi7k1RF+P+U/ZTXHBJGggMw5w5HvTFYs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8E1/kxcThZxKT+6LoYF0qh0PTTazrjtplQcuadg916I=; b=lVlz56ovkQpGB1uW7rgPUlD6MIETBVS7EVKZUyT1MIwkjHFprLHKmpqgytoCqQQYql NcsnSqi6utM9diorezOKmx9ymjYts2M70N+8tfkMf2QEUVrCWNv/kPlcfcg++WIsXrdx zX5Ey2FbuC3vuF96Bzk1hroY18Sa2DrjAKU+jTKLBbWo9CrAJlPg2KGFH0ggmhSc8Rip zvd4x1IGxiLuEAdIgwzRINWsIbmvZvEx6rO51WKKSzWljp3i2JTozf/+KkF7wKeRy2A0 KvpQmUsTv7aLtf93spxdXcQE3carO2P0CKw7B8aWQrj3PWVOagfIVy2TrKxufzyi3hv+ JFFA== X-Gm-Message-State: AG10YOTuyvEVlPsrXlAqalylu6FDpuSSWTJSqxrIhNAUpaJLtLkE3qWuskEAtcyyaFfERg== X-Received: by 10.28.179.130 with SMTP id c124mr10881493wmf.76.1454594306440; Thu, 04 Feb 2016 05:58:26 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id l194sm26656734wmb.14.2016.02.04.05.58.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Feb 2016 05:58:25 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: Wenwei Tao Subject: [PATCH 1/5] lightnvm: put bio before return Date: Thu, 4 Feb 2016 14:57:04 +0100 Message-Id: <1454594228-18970-2-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454594228-18970-1-git-send-email-m@bjorling.me> References: <1454594228-18970-1-git-send-email-m@bjorling.me> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wenwei Tao The bio is not returned if the data page cannot be allocated. Signed-off-by: Wenwei Tao --- drivers/lightnvm/rrpc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index c4d0b04..775bf6c2 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -300,8 +300,10 @@ static int rrpc_move_valid_pages(struct rrpc *rrpc, struct rrpc_block *rblk) } page = mempool_alloc(rrpc->page_pool, GFP_NOIO); - if (!page) + if (!page) { + bio_put(bio); return -ENOMEM; + } while ((slot = find_first_zero_bit(rblk->invalid_pages, nr_pgs_per_blk)) < nr_pgs_per_blk) {