Received: by 10.213.65.68 with SMTP id h4csp682884imn; Tue, 27 Mar 2018 06:57:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx48OE7qhTwYaoUFBlC5TBmAxGa+nXbQmIQA1ArgsUr9ZNFSQ/V/hSgvPYse3btbNrOYjvBkC X-Received: by 10.167.128.194 with SMTP id a2mr3868696pfn.186.1522159076403; Tue, 27 Mar 2018 06:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522159076; cv=none; d=google.com; s=arc-20160816; b=vR180375NmV/k6wpezw30OisycCVLciu1MxypWF63mQ/lb+VW8/HwHVZdijzLHocNZ veosqEVebFC8wfzqckAKS8AR7cTK/PVsV6iNSPXDcm38wroc5bdCPl1qU35F7c9muz3x epMDwWqLZPdTRAc5UzxC9ng48q6h3vtyLGRrW6tuSU63R/6MG93yoyEzD2pG17Z7VdWl r5yxF0NuZ1g8JtSSYbNL46KQ3ZPQpiRqF+lOC8Et2vxTT8W9OxbyK8w6pVEbwuJRTWh2 TQo6dSQQq7k5KH5Jjd9Sq8rFILj7UCGw7zcgTZp9152O1UFSDpsA5KjSEax4GANEnAnW QGZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :arc-authentication-results; bh=HSEfCNyZ3XJwe3T/9LJIiJsRAvoo/CEORETxGCYqbtI=; b=07jf5t6nBIxw8uJQT5XTgus7berhuMrTeTmNRU65OoUQiGqdvfQn+ivLerzjuBo9J9 tAUsnHDCyaRRlCAiFpYVbstl38vnHepfTAr8d55bWO6vsz2sV8ruMqm3DBVjWB6HyFdp 1fLDvOGAKP3Aw0vd0EXRWik/tOu9im1PfLMI1MB8v2Qav82bvAUt5YweQKqQEffVMwz5 xKdcauWK5PFtK/qMjSSx/5FgDP8GVlCpAJFwj1kolbMugfDZGkWRFQjWtvtUL2Tt+jt4 FdUZ7h7Rf4/fgAp17rd+plfI6g+PYyLNA7D2uNjqKJhAd05N/5ng7rm3gUXH0d0sZLKT C9Kw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si872876pge.733.2018.03.27.06.57.41; Tue, 27 Mar 2018 06:57:56 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752691AbeC0N4n (ORCPT + 99 others); Tue, 27 Mar 2018 09:56:43 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43946 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752275AbeC0N4l (ORCPT ); Tue, 27 Mar 2018 09:56:41 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7354FF0803; Tue, 27 Mar 2018 13:56:41 +0000 (UTC) Received: from lszubowi.bos.redhat.com (dhcp-17-209.bos.redhat.com [10.18.17.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id 386F52026E03; Tue, 27 Mar 2018 13:56:41 +0000 (UTC) From: Lenny Szubowicz To: rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ACPI: acpi_pad: Fix memory leak in power saving threads Date: Tue, 27 Mar 2018 09:56:40 -0400 Message-Id: <1522159000-7778-1-git-send-email-lszubowi@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 27 Mar 2018 13:56:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 27 Mar 2018 13:56:41 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lszubowi@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix once per second (round_robin_time) memory leak of about 1 KB in each acpi_pad kernel idling thread that is activated. Found by testing with kmemleak. Signed-off-by: Lenny Szubowicz --- drivers/acpi/acpi_pad.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index 7544310..552c1f7 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c @@ -110,6 +110,7 @@ static void round_robin_cpu(unsigned int tsk_index) cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus); if (cpumask_empty(tmp)) { mutex_unlock(&round_robin_lock); + free_cpumask_var(tmp); return; } for_each_cpu(cpu, tmp) { @@ -127,6 +128,8 @@ static void round_robin_cpu(unsigned int tsk_index) mutex_unlock(&round_robin_lock); set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu)); + + free_cpumask_var(tmp); } static void exit_round_robin(unsigned int tsk_index) -- 1.8.3.1