Received: by 10.223.185.116 with SMTP id b49csp6342636wrg; Wed, 28 Feb 2018 07:53:59 -0800 (PST) X-Google-Smtp-Source: AG47ELsLQ6a4X5/M75yshiNUPYKqmaB2/hOevP4LMkxOC6xhbQ74lXo5BSlU+E3Mh9tRp7ewdTPD X-Received: by 10.98.16.131 with SMTP id 3mr3277500pfq.188.1519833239605; Wed, 28 Feb 2018 07:53:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519833239; cv=none; d=google.com; s=arc-20160816; b=ukGAt0bzh22X98k+p/MYWedu6xFkoYPFQcihC3CfldZ1GAUQBekFaKZxx0zGXB3t5G Kj/Cua1NT6K2eSrpnfYl4M4nypLUMCXwrCb/asmW+EO0fa/nscoTi2ESW+uZZ6yWCyZ2 HPsmLe7IIsf5Ju7aB5iuCKHIYC16JCv6ZGYi839OQ/k7bJWNklz3dHEEvo0SpXE+UF3e 8GWd9PzAEo1wwdQCbgR14oTgly2sLStsfiykIZxNYOEd8tInpdDoqPbkeUq4ypJWSGXJ fU7/3y9MwFxTP0ybWnysaQiQr2VwUdPihsURpjuvO098xvzQi4ffYLM1Vg+YIJCpBLdA XWcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=qarby9sTwATY9vYLpkvYtqx3hP81tAKavaatkVSiG+Y=; b=VVfjRXbKelYs9tHevQIuZi+Ex6IMsByJ2R5AxsYa7rNkp4/jvoydPARreeKRqLh5SD V74gUaoQCTmHrTnl45/r+rQxyaDDSOYZUMmFcd+9YACHfYLuwfeABXKPMHyl5IJpv7RQ 9A+egp9qOCRAMJ89rM6G6xFlfYyT2+oK88xxPCKDGJBZKA0Mz1JmcFPKSAQMbbc/iThJ M6p1zOjL4ofHHl2HoJ+Uwv9+Ac8w0Vavu9MzouldRjIbH5rfva815D3yXuMRdyAjEJ9H iJno5SiE9roiihzzqC9/T+fjupQZGM3skJlZggRdDhuFsytFN+L1lK4YEUi/mOhrpLiW dI1A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31-v6si1427011pli.679.2018.02.28.07.53.45; Wed, 28 Feb 2018 07:53:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933866AbeB1Pwa (ORCPT + 99 others); Wed, 28 Feb 2018 10:52:30 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:34397 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932426AbeB1Pw0 (ORCPT ); Wed, 28 Feb 2018 10:52:26 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yq-0006XS-O4; Wed, 28 Feb 2018 15:22:29 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yj-0000Di-1z; Wed, 28 Feb 2018 15:22:21 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Marek Belisko" , "Dmitry Torokhov" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 185/254] Input: twl4030-vibra - fix ERROR: Bad of_node_put() warning In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Marek Belisko commit e661d0a04462dd98667f8947141bd8defab5b34a upstream. Fix following: [ 8.862274] ERROR: Bad of_node_put() on /ocp/i2c@48070000/twl@48/audio [ 8.869293] CPU: 0 PID: 1003 Comm: modprobe Not tainted 4.2.0-rc2-letux+ #1175 [ 8.876922] Hardware name: Generic OMAP36xx (Flattened Device Tree) [ 8.883514] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 8.891693] [] (show_stack) from [] (dump_stack+0x78/0x94) [ 8.899322] [] (dump_stack) from [] (kobject_release+0x68/0x7c) [ 8.907409] [] (kobject_release) from [] (twl4030_vibra_probe+0x74/0x188 [twl4030_vibra]) [ 8.917877] [] (twl4030_vibra_probe [twl4030_vibra]) from [] (platform_drv_probe+0x48/0x90) [ 8.928497] [] (platform_drv_probe) from [] (really_probe+0xd4/0x238) [ 8.937103] [] (really_probe) from [] (driver_probe_device+0x30/0x48) [ 8.945678] [] (driver_probe_device) from [] (__driver_attach+0x68/0x8c) [ 8.954589] [] (__driver_attach) from [] (bus_for_each_dev+0x50/0x84) [ 8.963226] [] (bus_for_each_dev) from [] (bus_add_driver+0xcc/0x1e4) [ 8.971832] [] (bus_add_driver) from [] (driver_register+0x9c/0xe0) [ 8.980255] [] (driver_register) from [] (do_one_initcall+0x100/0x1b8) [ 8.988983] [] (do_one_initcall) from [] (do_init_module+0x58/0x1c0) [ 8.997497] [] (do_init_module) from [] (SyS_init_module+0x54/0x64) [ 9.005950] [] (SyS_init_module) from [] (ret_fast_syscall+0x0/0x54) [ 9.015838] input: twl4030:vibrator as /devices/platform/68000000.ocp/48070000.i2c/i2c-0/0-0048/48070000.i2c:twl@48:audio/input/input2 node passed to of_find_node_by_name is put inside that function and new node is returned if found. Free returned node not already freed node. Signed-off-by: Marek Belisko Signed-off-by: Dmitry Torokhov Signed-off-by: Ben Hutchings --- drivers/input/misc/twl4030-vibra.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/input/misc/twl4030-vibra.c +++ b/drivers/input/misc/twl4030-vibra.c @@ -185,7 +185,8 @@ static bool twl4030_vibra_check_coexist( if (pdata && pdata->coexist) return true; - if (of_find_node_by_name(node, "codec")) { + node = of_find_node_by_name(node, "codec"); + if (node) { of_node_put(node); return true; }