From patchwork Thu Mar 12 07:43:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5991211 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B47D69FB84 for ; Thu, 12 Mar 2015 07:45:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E054320396 for ; Thu, 12 Mar 2015 07:45:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1070203A0 for ; Thu, 12 Mar 2015 07:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752782AbbCLHo7 (ORCPT ); Thu, 12 Mar 2015 03:44:59 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:60094 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751467AbbCLHo4 (ORCPT ); Thu, 12 Mar 2015 03:44:56 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NL3003EB9PFQT50@mailout4.w1.samsung.com>; Thu, 12 Mar 2015 07:48:51 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-62-55014364678a Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id DF.EA.07834.46341055; Thu, 12 Mar 2015 07:42:28 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NL300KWS9IOZC60@eusync2.samsung.com>; Thu, 12 Mar 2015 07:44:53 +0000 (GMT) From: Krzysztof Kozlowski To: Jiri Kosina , Henrik Rydberg , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org Cc: Krzysztof Kozlowski , stable@vger.kernel.org Subject: [RESEND PATCH v6 01/22] compal-laptop: Fix leaking hwmon device Date: Thu, 12 Mar 2015 08:43:59 +0100 Message-id: <1426146260-30081-2-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1426146260-30081-1-git-send-email-k.kozlowski@samsung.com> References: <1426146260-30081-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupiluLIzCtJLcpLzFFi42I5/e/4Fd0UZ8ZQg7dTOSwmPXnPbDFx5WRm i91zFrNYvH5haHHz0zdWi8u75rBZfO49wmhx4ts0JovTu0ssFmx8xOjA5fF51StWj52z7rJ7 bF6h5bFpVSebR9+WVYweZxYcYff4vEkugD2KyyYlNSezLLVI3y6BK6Ph0lnmgkvcFSt3GTcw PuTsYuTkkBAwkXh7/ykzhC0mceHeerYuRi4OIYGljBLL7r1jB0kICfQxSezdmAhiswkYS2xe vgSsSERgPpNE/6oTrCAJZgFPiXd/H4I1CAt4SNw8Op8RxGYRUJU4ee842AZeAXeJxe0v2SG2 yUmcPDYZqJeDgxOo/vUiHohd7hIzl31in8DIu4CRYRWjaGppckFxUnquoV5xYm5xaV66XnJ+ 7iZGSPh92cG4+JjVIUYBDkYlHt6IPoZQIdbEsuLK3EOMEhzMSiK8HFaMoUK8KYmVValF+fFF pTmpxYcYmTg4pRoYuyVCpeMniyzak+9u65uYNKXFbsvj55zl/s9Y7lwzXVBucnXlvAk9PVUF Qn7xPE2a019/8rNO2DHdbGp7TZe9c/R2OV2WieWe31c97vd0Npp8NGFmcvHFAvet783NTr2e l74s3211MzP31ka1MO+XIZK/V1vzGL7Q8X28o1LNRvvhk1/XjJcpsRRnJBpqMRcVJwIAtqPN Uh0CAAA= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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;