From patchwork Fri Jun 30 15:56:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= X-Patchwork-Id: 9819953 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 20498602B1 for ; Fri, 30 Jun 2017 15:57:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2067A285C8 for ; Fri, 30 Jun 2017 15:57:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 156CD286B0; Fri, 30 Jun 2017 15:57:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C427285C8 for ; Fri, 30 Jun 2017 15:57:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752498AbdF3P5F (ORCPT ); Fri, 30 Jun 2017 11:57:05 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:34834 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752472AbdF3P5E (ORCPT ); Fri, 30 Jun 2017 11:57:04 -0400 Received: by mail-wm0-f42.google.com with SMTP id w126so113902281wme.0 for ; Fri, 30 Jun 2017 08:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9j8FIvxP22ZBZkxbH8CdHtNw+V6l3I4LwcuLZs9mWI4=; b=P5jPhyL390xSdSC6heBUeomo51C5wgADzAStrwkalsgBWOg2+Ux0hJKHtFrUR4F+4v 1xXKykJQgX4qEYeZBt9jTUFXc9gny67AkKcOhsi19yuYfzhAAxsDFy2Jf/OY3Fgu4QOx gF2rXledG1Ys52RGsrgWJ+5+lBBQvTTsZ13HoA9ZYEiBqoyvnsNHksIHMYNcDoIqxnFj 6zmB/TpFP60zt+QRwxFczB32ZOxNWjqd9HQwxR2SaVWV+deN4Ogi0hh1CWXGiH794KN8 OPyPRooKFo2KsVJ+ItntpujFOre90LQNqt0ZGdbZo8CzvwRHQlEhwPpZBfJkI110WF7Y 28Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9j8FIvxP22ZBZkxbH8CdHtNw+V6l3I4LwcuLZs9mWI4=; b=WVlwD57YqVk9Z435EIElb49UQAZsSEJQ4Rem3DvKacZv427ArGAHoWODO8/sI+lJS/ A6cc7FMr6/W2UU1qZL0jlmls5UlB+vQIsk1y6FC0OpSuazTZ45d1sqkfIGFoAfFpKY2l BLIj9ua3BY39N99My9tywj9dc3x1rrNnnlI42YCNVVLZRJN/uWAp9iNeRdyPKRfB6lWm 8WBjxtjDUbAEuVO4YWnVQ3T249pPuZhv1WqkF87qqz+N9lLOM0DyazlaWx0OvP47uEQo eZOJj/xdSmViI9LYMK9kvHkNN19rNezM9TCtU+/SlbPga4dkDCbtkymrzFFiJNWHpl3g 4y5Q== X-Gm-Message-State: AKS2vOzHs0N3XRRlggdld+rOuNKf/oKOwdt4peHbexuHP8wW44CrhE5Z cUXzfVkTfR7vkDpT X-Received: by 10.80.147.134 with SMTP id o6mr5948079eda.102.1498838212656; Fri, 30 Jun 2017 08:56:52 -0700 (PDT) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id d36sm2705988edb.63.2017.06.30.08.56.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Jun 2017 08:56:51 -0700 (PDT) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io, axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 02/10] lightnvm: pblk: fix double-free on pblk init Date: Fri, 30 Jun 2017 17:56:35 +0200 Message-Id: <1498838203-21539-3-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498838203-21539-1-git-send-email-javier@cnexlabs.com> References: <1498838203-21539-1-git-send-email-javier@cnexlabs.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Prevent pblk->lines being double freed in case of an error during pblk initialization. Fixes: dd2a43437337: "lightnvm: pblk: sched. metadata on write thread" Reported-by: Dan Carpenter Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-init.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 8bdaf7e0e00b..b3fc310aa51c 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -812,8 +812,6 @@ static int pblk_lines_init(struct pblk *pblk) fail_free_lines: while (--i >= 0) pblk_free_line_bitmaps(&pblk->lines[i]); - - kfree(pblk->lines); fail_free_bb_aux: kfree(l_mg->bb_aux); fail_free_bb_template: