From patchwork Tue Jan 24 21:11:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 92398 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1916045qgi; Tue, 24 Jan 2017 13:11:59 -0800 (PST) X-Received: by 10.99.24.92 with SMTP id 28mr42970651pgy.100.1485292319113; Tue, 24 Jan 2017 13:11:59 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k76si20669491pfg.249.2017.01.24.13.11.58; Tue, 24 Jan 2017 13:11:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751041AbdAXVLv (ORCPT + 25 others); Tue, 24 Jan 2017 16:11:51 -0500 Received: from mail-io0-f172.google.com ([209.85.223.172]:35315 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbdAXVLj (ORCPT ); Tue, 24 Jan 2017 16:11:39 -0500 Received: by mail-io0-f172.google.com with SMTP id j18so145870443ioe.2 for ; Tue, 24 Jan 2017 13:11:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bSpxF9F5gZDnQAf019NdAxwSMLRzjVoAWgddiV+6dyw=; b=CRg5Mj0wcQNznxx3hhSJmMs1EwIhxggSuRBK2pjCsgm4A3AeQYam0y9xadWswEXwLH 4DdODQnVmuKck5EEgiHjMBfUvnQ0kb4QANLSAGP+T4wPJy+lf9I1rmg7oNAzVbHFngNo /7TtLm+dxiiyeeBtja2Izzf5GWnOD+jJqYFdo= 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; bh=bSpxF9F5gZDnQAf019NdAxwSMLRzjVoAWgddiV+6dyw=; b=gr600aCupFaZKjLTEKGvpdts+hrq9g90ssVkAjZMyOO9jP6s/JJ+Wes52ycLDFHEoc Fs/wgSeGMSvO1aaEv/sXVq5xG+6cK9cK5OxnoZDvaO4r5EE9u08UcG1MXwvS2e6dylGz Ndogzc+BIgJrOONuQn9LU2D/s+6R4azeh+hKRCtcvEJPiC6p15yLd68L1CdeKGR2qSSL xt4ANG9rn77xcKSkWbvd8EuiAjQbFQ97Z7yR2ERPLuQ0a2I6gDiY8RdlbeKYQ3/vAuXC AKH/rBw3MnN8n0If/xxdUrW8LAWHFmxhIINP+8rVtNA9bv5+BpU/qVomKnmB6q365opO KZBA== X-Gm-Message-State: AIkVDXIb58sIuHJO1NpIdl7pMA3G2p+nu+qgC+VM3LPdYKFP4cslKWOLuq679zTBDfhmr3OC X-Received: by 10.107.135.147 with SMTP id r19mr30611579ioi.36.1485292298098; Tue, 24 Jan 2017 13:11:38 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id k66sm289893itg.8.2017.01.24.13.11.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jan 2017 13:11:37 -0800 (PST) From: Mathieu Poirier To: mingo@redhat.com, peterz@infradead.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] sched/core: Fix &rd->cpudl memory leak Date: Tue, 24 Jan 2017 14:11:35 -0700 Message-Id: <1485292295-21298-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485292295-21298-1-git-send-email-mathieu.poirier@linaro.org> References: <1485292295-21298-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While in the process of initialising a root domain, if function cpupri_init() fails the memory allocated in cpudl_init() is not reclaimed. Adding a new goto target to cleanup the previous initialistion of the root_domain's dl_bw structure reclaims said memory. Signed-off-by: Mathieu Poirier --- kernel/sched/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 5c01ac0f915a..f06ce70757a7 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5884,9 +5884,11 @@ static int init_rootdomain(struct root_domain *rd) goto free_rto_mask; if (cpupri_init(&rd->cpupri) != 0) - goto free_rto_mask; + goto free_cpudl; return 0; +free_cpudl: + cpudl_cleanup(&rd->cpudl); free_rto_mask: free_cpumask_var(rd->rto_mask); free_dlo_mask: