From patchwork Mon Nov 4 16:24:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 178437 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1698749ilf; Mon, 4 Nov 2019 08:24:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwSiuE/O9WgWqqgeDOLMNOOw0v2RvgCjdEBIlC3XnXp7BtumcOapPavw8D5/ZFO3RHDlgtc X-Received: by 2002:a05:6402:1a50:: with SMTP id bf16mr9053852edb.116.1572884668339; Mon, 04 Nov 2019 08:24:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572884668; cv=none; d=google.com; s=arc-20160816; b=SoM6snNtz+t1Ii6Vl+5X5KdLVz6+7KxB//YHECq5fYoZpp0X6AUuKbMy1lwgb8bU63 kQlng8C9vwHeBHU0Vg/ELKS8Mabj2Y2426npQPEpLAhVGuHWgHKTB3IzlsfqXpw1WytH s7zhz5tX2wkRFtU3bl4JuXfpm6iAQbYG4zzewzD7eSItMROKx+NpkD0c9HfSXnMmMOn0 8OCNo2QFJZkUZ2fIgUPUP0aMjgMap12jhMdqUXaj6FjzGRrLgoDJwTOv7hPBEu1PLUp2 tnQ2gb/T5RtIYjtT9PI+XSVddSfSaAPWfhvj7N0iPMv7EhLIma+oE8XTfzEPr6GWARxl TghA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=h7fAAmgCYgA9BJLRQcWv51AQbcBIhG2REXp2EloKlLk=; b=j9qRu3rKSOsEXjUVSR88FkC3E3pvoIjiUDkTvcrk0zchOwBRrcg8qaqmjG6JLvqlLU abVfZ3fs/x9z8VtaNBQUF0QSuwVi2z70QnaFwZO5qV5+g1TVR2V820l3nzTURMIsC0TG c8YhTRClYL7Mmue6jRJ1io5dpouhs73d3CMW7ni5OyvXFh/wEjQ9Addze5Ldx9dc3UET dxkM3CBPUZigJoXhRhtc3eZKrsiKn5rYjsxm/f5rFgF5ZlrE0V545n7MiaHUpyED/qoY 45JG7BJLzDJHsboR6ReFDpvkwiCPTh2dUivMjPWabsByFd4b/4q0uTcClIHTfW7wSBuK cWjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=of2Rqi1e; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si7880328eda.262.2019.11.04.08.24.28; Mon, 04 Nov 2019 08:24:28 -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=@ti.com header.s=ti-com-17Q1 header.b=of2Rqi1e; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729432AbfKDQY1 (ORCPT + 26 others); Mon, 4 Nov 2019 11:24:27 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:52526 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729122AbfKDQY0 (ORCPT ); Mon, 4 Nov 2019 11:24:26 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xA4GOJYc048603; Mon, 4 Nov 2019 10:24:19 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1572884659; bh=h7fAAmgCYgA9BJLRQcWv51AQbcBIhG2REXp2EloKlLk=; h=From:To:CC:Subject:Date; b=of2Rqi1epxBgHInzi0tATDyTD5PG/Jj1KwpJH1g43fN6IpKV1pULiS5rs2n5VUwzl bG2fiqgv4vaCt6JJ4YBjrw9uvZkYwMt+5FF2J4JiCIyAIa9bilBdRqMm52pMK1W63I 8mHnA2Pp9d6dkK07hcQavK/urawb/GKczlcGjNAo= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xA4GOJK2055065 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Nov 2019 10:24:19 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 4 Nov 2019 10:24:03 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 4 Nov 2019 10:24:03 -0600 Received: from jadmar.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id xA4GOGOm011098; Mon, 4 Nov 2019 10:24:16 -0600 From: Jyri Sarha To: , CC: , , Subject: [PATCH] reset: Free struct reset_control_array in reset_control_array_put() Date: Mon, 4 Nov 2019 18:24:15 +0200 Message-ID: <9c8c5c337a9351a561a4bf18f2faa1e9a01b50e6.1572884515.git.jsarha@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix memory leak in devm_reset_control_array_get(). Free also the struct reset_control_array pointer in reset_control_array_put() not only the reset-controls stored in it. Reported-by: Tomi Valkeinen Signed-off-by: Jyri Sarha --- drivers/reset/core.c | 2 ++ 1 file changed, 2 insertions(+) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/reset/core.c b/drivers/reset/core.c index 213ff40dda11..85d9676ee969 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -748,6 +748,8 @@ static void reset_control_array_put(struct reset_control_array *resets) for (i = 0; i < resets->num_rstcs; i++) __reset_control_put_internal(resets->rstc[i]); mutex_unlock(&reset_list_mutex); + + kfree(resets); } /**