From patchwork Tue Mar 10 08:27:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5975381 Return-Path: X-Original-To: patchwork-linux-acpi@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 D38EFBF440 for ; Tue, 10 Mar 2015 08:37:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CB0220251 for ; Tue, 10 Mar 2015 08:37:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 372CC2024D for ; Tue, 10 Mar 2015 08:37:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751695AbbCJI15 (ORCPT ); Tue, 10 Mar 2015 04:27:57 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:36137 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186AbbCJI1t (ORCPT ); Tue, 10 Mar 2015 04:27:49 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NKZ00833MCY1W10@mailout2.w1.samsung.com>; Tue, 10 Mar 2015 08:31:47 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-04-54feaa6cb90c Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 9B.EF.26295.C6AAEF45; Tue, 10 Mar 2015 08:25:16 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NKZ0033KM64IB70@eusync4.samsung.com>; Tue, 10 Mar 2015 08:27:46 +0000 (GMT) From: Krzysztof Kozlowski To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , "Rafael J. Wysocki" , Len Brown , Jiri Kosina , David Herrmann , Cezary Jackiewicz , Darren Hart , Support Opensource , Milo Kim , Linus Walleij , Samuel Ortiz , Lee Jones , linux-arm-kernel@lists.infradead.org, Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Daniel Mack , Haojian Zhuang , Robert Jarzmik , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-input@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@opensource.wolfsonmicro.com, ac100@lists.launchpad.net, linux-tegra@vger.kernel.org, devel@driverdev.osuosl.org Cc: Thomas Gleixner , Pavel Machek , Kyungmin Park , Marek Szyprowski , Krzysztof Kozlowski , stable@vger.kernel.org Subject: [PATCH v6 01/22] compal-laptop: Fix leaking hwmon device Date: Tue, 10 Mar 2015 09:27:05 +0100 Message-id: <1425976046-20973-2-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1425976046-20973-1-git-send-email-k.kozlowski@samsung.com> References: <1425976046-20973-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAy2Ra0hTcRyG+++cnZ1Zg6MuPYkYiV0UvGXSD7PoRv4NhCKLqKCmDpU2lU0t o1LECLd02ipIJDQ150TzWnmlzJnXafOW4RbLArWZpTNi1cpp3x6e94X3w0sTLvWkB52YlCqW JYkk3pQTOWB/M+Ev0dqjg/R/AyF/6BsHynuVJGT/mSfh7qdFAtoHbTwoG3UDRWkQFFapCRip 3QsP6t2hrbiMhC+zwTCUbeHBhxUdghbzAgX3fldyoLJThaBhZoILU0s/uDDaWkzBcl43glxr EQU13UYeVNpqSTC8LFktL/ylwNivo6C6fZaAwQEDF4osrjCg5MJAWyqU1H9E0HHrLQGNDfcJ +Fk3wz3ogzVLgdjU+ZrEqtplLm4pMvLw5wI1Dzdq/HCDNpfC0xPtFP6q1/Pwo76TuLE8E+vu TJN4rvAXhRc7xyncNH6bxPlNWnTC7ZxTeJxYkpgulgUeuOSUkGUYIlIMG69WtYZkITNfgfg0 y+xhc3psxDq7sSOmp5QCOdEuTAVix8bySEfgwuRz2KZhdwdTTAjbWFm+VhIyOpq1Lc7yHAHB zCN2yHxdgWjalTnETpjiHJpktrM5/aNcBwuYCNYybUPrY15sX496zfMZzFqt7/9vRbBGw3dU gAQlaIMWbRanxabIY+KluwPkIqk8LSk+IDZZ2oDWb155gSp6wroQQyPvTYJ35+3RLlxRujxD 2oVYmvAWCnSqVSWIE2VcE8uSL8rSJGJ5F+LQfI8sFF/kVeA7x0qoqN7qWPVyiDl/S//hsK38 V49Px/l7PjFfsE+OJRn8PGpOGY+XhoZqfSTPgKO00R3Hbj6MCm+OtNZdcdu1w2tf5OQZ3/ae lrNi4Y3L3cXb+ha1jFeL6rlGI1A5ZzoLpc0SZ2pqvylGqZ+2eO6kxCNHhpeO6nyV3qQ8QRTs R8jkon8FlbqZxAIAAA== Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The commit c2be45f09bb0 ("compal-laptop: Use devm_hwmon_device_register_with_groups") wanted to change the registering of hwmon device to resource-managed version. It mostly did it except the main thing - it forgot to use devm-like function so the hwmon device leaked after device removal or probe failure. Signed-off-by: Krzysztof Kozlowski Fixes: c2be45f09bb0 ("compal-laptop: Use devm_hwmon_device_register_with_groups") Cc: Acked-by: Guenter Roeck Acked-by: Darren Hart --- Changes since previous submission: 1. Add Darren's ack. http://lkml.iu.edu/hypermail/linux/kernel/1503.0/01895.html --- drivers/platform/x86/compal-laptop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c index 15c0fab2bfa1..eb9885e7fb0e 100644 --- a/drivers/platform/x86/compal-laptop.c +++ b/drivers/platform/x86/compal-laptop.c @@ -1026,9 +1026,9 @@ static int compal_probe(struct platform_device *pdev) if (err) return err; - hwmon_dev = hwmon_device_register_with_groups(&pdev->dev, - "compal", data, - compal_hwmon_groups); + hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev, + "compal", data, + compal_hwmon_groups); if (IS_ERR(hwmon_dev)) { err = PTR_ERR(hwmon_dev); goto remove;