From patchwork Thu Jan 28 10:08:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenwei Tao X-Patchwork-Id: 8148281 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 268FBBEEE5 for ; Thu, 28 Jan 2016 10:08:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55BFC20320 for ; Thu, 28 Jan 2016 10:08:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 00169201BB for ; Thu, 28 Jan 2016 10:08:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751434AbcA1KI3 (ORCPT ); Thu, 28 Jan 2016 05:08:29 -0500 Received: from mail-pf0-f182.google.com ([209.85.192.182]:34799 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751400AbcA1KI1 (ORCPT ); Thu, 28 Jan 2016 05:08:27 -0500 Received: by mail-pf0-f182.google.com with SMTP id o185so16648264pfb.1; Thu, 28 Jan 2016 02:08:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=U6/3WJOs3wGYmbD8C7AzWRFakb3jyNbGHYpPWWDj2VQ=; b=FoeAdTY05/zs/0z0/nXBq4uFDEJEHqvtwKYA0L3nj/zX392hUtUTcXFIerE1XQZScO hRyTFqRckudeKllrstvXvB59tMtfUE4xXjUcIRrq1J/OE4QZxAt3yJVk3+NIqupRStpn 3lqup1maeXLyafxrid6u+7dixM57zS4GWbY1bmXvYmxgulJWE/kNUaSrzj5EXpF75ksl 8EK8HOaIu/hfYJoqfT9sfpuK3e5vAj+Q1O+FtXNPNGXoCM3ifKev0sjxNo7yGG8bLtaA uWSw1lsWup8cRKNBC9xbvYEJqGWzq1riwMNBTy9Y1aVu3XFl+05+8bzsJ33CDkwaEvAs 0DQQ== 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; bh=U6/3WJOs3wGYmbD8C7AzWRFakb3jyNbGHYpPWWDj2VQ=; b=GLMq3spec6nnwPK8WRfo8jRvOYRb4lQZCqCtV2QMl44Knplpv40QBNsyyBwK6o2e41 BaKQSBn/+CkbmUGnDCEfznaXlnVrC90Qbg2afR11T8ULeUUsN768zHOzbiOCK147ElxX YHbe22F6ZrXkfaam4vzK4fx8T6I3z+Vo8h2CWLG6BxwOp8DHcqlK5j36lXxZvuqABpPW mk9oNbzofQ3CCuhhMIyDwkUvliXi0L/vAPpshVl2crq2Xe8IlKDbC7OvYsvCfforHNqv YNnc3NpOe065yjrOlRiJzzNcPj6adAZhOZWLY/R7kl8hPCJNGTLY7UHa9jMnR5D2MwJK Vj0A== X-Gm-Message-State: AG10YOT9lX/O2prJXZBTfg/Bukpy4aFqADNfKG7PA3oRkpidb96AWKlHQZlJLbdfhU8k7g== X-Received: by 10.98.68.220 with SMTP id m89mr3209001pfi.65.1453975706658; Thu, 28 Jan 2016 02:08:26 -0800 (PST) Received: from localhost.localdomain.com ([111.204.49.2]) by smtp.gmail.com with ESMTPSA id d25sm12826636pfb.74.2016.01.28.02.08.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2016 02:08:26 -0800 (PST) From: Wenwei Tao To: mb@lightnvm.io Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Subject: [PATCH] lightnvm: put bio before return Date: Thu, 28 Jan 2016 18:08:14 +0800 Message-Id: <1453975694-18305-1-git-send-email-ww.tao0320@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 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 d8c7595..307db1e 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) {