Received: by 10.223.176.46 with SMTP id f43csp2656042wra; Mon, 22 Jan 2018 01:01:06 -0800 (PST) X-Google-Smtp-Source: AH8x225Vwpam9rArsX4RhWYfRufNmDmrBoMqzpXYEIFvVWhZzJalki9ZD1iSPwfPjcmRaHhJnXe/ X-Received: by 10.98.57.27 with SMTP id g27mr7936345pfa.128.1516611666514; Mon, 22 Jan 2018 01:01:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516611666; cv=none; d=google.com; s=arc-20160816; b=j//ZGd5j6Qu37tbxQKZHGoGn3eZFzY7CtoUAjtYuo5R1QbxP0n7vKRKVP3B7EBOhHb zgUM+pWTXSmUcLtK5CBA3LJ8aw8lEGiUUx9fJpf4LHnRLgKlHp+FthpqWdbFH22LM1sg KJ/9TViEvmnJClIKb9IilZ3x3HMrseICEWpHomq9n2NbOrCFo32VkxmNeeeyzSn5hiW+ I8TgNptRME0fNiXlaJVDXJwL0e4rmi8Yl4coYCAi7rHYM0hTJ8DUwp0EpaiMp0ugn8Kq CJBEiAOqVxUxlMBvMvmRan6+hlRzGs55t2rWUpBViTY7khAmE4aFRgG/111TV8//n1WW v+9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=YuP3lTR3XoVY2D89due3o+7PmEElMYkFptnsp+p79sk=; b=Y45tDk3AwgvqJmJpTV/PNVEKYje5/HhyiEtbIeHbXe7lD9Q00VKHqqWFuct+BEkqGl 4aYM/svo5MYnRJsiF5YCxtmODHnDLL8oEsnXC2wWIRwoQo3SmgPmRjywsBuSXAUO3csY +2hGqDuuhseHgFYR41lVdmDnqg6Ve41QlDdDrTK9pyX++3CWO1Z/dy7w9OZWQNV9F2DX HQB0xjHLBAjgllF01VA+LhmP6DBylzMdnLfVNFXZ3SfH7tkloNLNa4bwVQtNp8STs0l0 i34VklVKQtuWli3lPFXhR8qUYQSA7uJQ3KtOnyh/LiBLc+RO/IpJkHhQt7ch+PXAJsYQ CpbQ== 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 z81si8930580pfa.224.2018.01.22.01.00.52; Mon, 22 Jan 2018 01:01:06 -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 S1753809AbeAVI7v (ORCPT + 99 others); Mon, 22 Jan 2018 03:59:51 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34074 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932088AbeAVIxt (ORCPT ); Mon, 22 Jan 2018 03:53:49 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 54067F2B; Mon, 22 Jan 2018 08:53:48 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Peter Ujfalusi , Dmitry Torokhov Subject: [PATCH 4.14 53/89] Input: twl6040-vibra - fix child-node lookup Date: Mon, 22 Jan 2018 09:45:33 +0100 Message-Id: <20180122084000.000740889@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083954.683903493@linuxfoundation.org> References: <20180122083954.683903493@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable 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: Greg Kroah-Hartman --- 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 @@ -248,8 +248,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");