From patchwork Sat Aug 31 06:45:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Libo Chen X-Patchwork-Id: 2852319 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A20979F313 for ; Sat, 31 Aug 2013 06:46:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA1D820315 for ; Sat, 31 Aug 2013 06:46:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F3285201EA for ; Sat, 31 Aug 2013 06:46:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757164Ab3HaGpz (ORCPT ); Sat, 31 Aug 2013 02:45:55 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:34238 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757088Ab3HaGps (ORCPT ); Sat, 31 Aug 2013 02:45:48 -0400 Received: from 172.24.2.119 (EHLO szxeml207-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BGW38560; Sat, 31 Aug 2013 14:45:16 +0800 (CST) Received: from SZXEML421-HUB.china.huawei.com (10.82.67.160) by szxeml207-edg.china.huawei.com (172.24.2.56) with Microsoft SMTP Server (TLS) id 14.1.323.7; Sat, 31 Aug 2013 14:45:10 +0800 Received: from [127.0.0.1] (10.135.72.158) by szxeml421-hub.china.huawei.com (10.82.67.160) with Microsoft SMTP Server id 14.1.323.7; Sat, 31 Aug 2013 14:45:07 +0800 Message-ID: <522190F1.3010103@huawei.com> Date: Sat, 31 Aug 2013 14:45:05 +0800 From: Libo Chen User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: CC: Bill Pemberton , , , , , LKML , Li Zefan , "zhangwei(Jovi)" Subject: [PATCH 3/3] driver: input: twl6040-vibra: fix missing of_node_put X-Originating-IP: [10.135.72.158] X-CFilter-Loop: Reflected Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 decrease twl6040_core_node device_node refcount after task completion There are two ways to implement the function of_node_put through the marco CONFIG_OF_DYNAMIC, so it is save to call directly. Signed-off-by: Libo Chen Acked-by: Peter Ujfalusi --- drivers/input/misc/twl6040-vibra.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c index 0c2dfc8..f16193a 100644 --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c @@ -271,12 +271,14 @@ static int twl6040_vibra_probe(struct platform_device *pdev) #endif if (!pdata && !twl6040_core_node) { + of_node_put(twl6040_core_node); dev_err(&pdev->dev, "platform_data not available\n"); return -EINVAL; } info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); if (!info) { + of_node_put(twl6040_core_node); dev_err(&pdev->dev, "couldn't allocate memory\n"); return -ENOMEM; } @@ -304,6 +306,7 @@ static int twl6040_vibra_probe(struct platform_device *pdev) &vddvibl_uV); of_property_read_u32(twl6040_core_node, "ti,vddvibr-uV", &vddvibr_uV); + of_node_put(twl6040_core_node); } if ((!info->vibldrv_res && !info->viblmotor_res) ||