Received: by 10.223.185.116 with SMTP id b49csp6384807wrg; Wed, 28 Feb 2018 08:32:13 -0800 (PST) X-Google-Smtp-Source: AH8x226ts93Uckh3mhyZTvTkLfPhXNF9qaFAKTHkUg0UhQUn5tvXPros4p0HYK9UaFpOm1rtwS0e X-Received: by 2002:a17:902:5482:: with SMTP id e2-v6mr18438449pli.65.1519835533016; Wed, 28 Feb 2018 08:32:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519835532; cv=none; d=google.com; s=arc-20160816; b=qD8Dx/vGX8cARToBoV4/yPuD4fJSxBxakkghlR4Tgp5/YA5LITgQnnRAwBb8zpUNar 9wfSHX/+G4KeVBxbWjivSHWpCwRnTMoYM/V+6CjRf3ohNm2Qf/cjUABMDAnrznyVzyGc 02Fywpc5MAgu+B127CQsvXsNvc641blfd6Yv74Dk9GjwNjYvmvyZDj46+9nThqPFyujE GJz0GxzxdXPWQli8WvnQ4zVA3ABRcoDw3AKQEi+vpes4IWIJNf2/Tgo3o0NPc9j7SK2k 1ZNAXgk1mvmrRjAwWI0yH/gIfOHpzLbTjAD5Do0MAvo1HpTMOtv+4qg4HssO1AYb8pLV vyOw== 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=FnPEY0U5vsanmMs+nZJQatf5Shqc3rFjk25kQNqKIdk=; b=0Ws5Q1Mu7oklVnk9KgOr00SW24e640ReUxQgNkc7E+ul4k7Eh/bRxCCCYzlWgUFpHN jF//9wTfllr+8FfihtX0ab7EFHnPjSVTimtkbqFnWQzEDW/bshKsMlyG2UNQKBp1+mpj NXwKvtD69q8rrJp0IC3SjxZRl+PSQxJbUxnr2lmEXHfaIeLXvz4u/yqMtT/25efWimQu OGHkjZeqguUl6LsvxOMlBLbBxyhOlr5mhcjJQ+Mlkg7ZGnL13y1HDoi7LIYQWzLZ5L4n GaX2jEJEFdaJ6AhfJq/gCK2/w+9ocMvK36Ljd1oMCkhGRdxEVHgWdCz5CtHPKnjBccDv +uMA== 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 70-v6si1521643ple.147.2018.02.28.08.31.58; Wed, 28 Feb 2018 08:32:12 -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 S934800AbeB1QbQ (ORCPT + 99 others); Wed, 28 Feb 2018 11:31:16 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35139 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932674AbeB1QPA (ORCPT ); Wed, 28 Feb 2018 11:15:00 -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-0006Xi-M0; Wed, 28 Feb 2018 15:22:29 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yj-0000EO-7L; 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, "Dmitry Torokhov" , "Johan Hovold" , "Peter Ujfalusi" , "H. Nikolaus Schaller" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 188/254] Input: twl6040-vibra - fix child-node lookup 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: Johan Hovold commit dcaf12a8b0bbdbfcfa2be8dff2c4948d9844b4ad upstream. Fix child-node lookup during probe, which ended up searching the whole device tree depth-first starting at parent rather than just matching on its children. Later sanity checks on node properties (which would likely be missing) should prevent this from causing much trouble however, especially as the original premature free of the parent node has already been fixed separately (but that "fix" was apparently never backported to stable). Fixes: e7ec014a47e4 ("Input: twl6040-vibra - update for device tree support") Fixes: c52c545ead97 ("Input: twl6040-vibra - fix DT node memory management") Signed-off-by: Johan Hovold Acked-by: Peter Ujfalusi Tested-by: H. Nikolaus Schaller (on Pyra OMAP5 hardware) Signed-off-by: Dmitry Torokhov Signed-off-by: Ben Hutchings --- drivers/input/misc/twl6040-vibra.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c @@ -264,8 +264,7 @@ static int twl6040_vibra_probe(struct pl int vddvibr_uV = 0; int error; - of_node_get(twl6040_core_dev->of_node); - twl6040_core_node = of_find_node_by_name(twl6040_core_dev->of_node, + twl6040_core_node = of_get_child_by_name(twl6040_core_dev->of_node, "vibra"); if (!twl6040_core_node) { dev_err(&pdev->dev, "parent of node is missing?\n");