Received: by 10.223.176.46 with SMTP id f43csp2644571wra; Mon, 22 Jan 2018 00:46:23 -0800 (PST) X-Google-Smtp-Source: AH8x227Kl8xKlyI07OGBlcl1a/D4QdoQ1OPzdLqto/Sw7ZYmmXwfrn9tQolHhSurwTm0TfWWo0BQ X-Received: by 10.99.111.136 with SMTP id k130mr6840012pgc.314.1516610782998; Mon, 22 Jan 2018 00:46:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516610782; cv=none; d=google.com; s=arc-20160816; b=zYXQIXYbqTg4IUT7MHI8BDzFKeTg4cKjtSzj7nncQpvTp/QP5bH2elU21n5PLOPgF1 4OPBb/vMhxfhFGN8oW6O4c/u56dGzoMnOUqkdqMS5vEr3ccVdB5TFisWOLLH1I7ajiP+ Be2gGm3UvIAlNJpbwl/5OVoOHoFijeAEnRPTZl2v0nh+XwC1mBka/NOYES0NyYOxO/ow xpF7ohw3XHEARBBuSN6nKwjc1LqRgOZzTKVosGQmzajCLbP3imdDBqKlr46Zx1Pukiqe JIhIU2oNGDwSD/9uboCY+Mvv7lfrWDnB5VyYGR528EBI5ZzaG57IR6jhcK3Q2qpAMd1V ZPZQ== 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=X13bXxtquMPyW6bCqT5bBDUVdh+v4QyyYehylvt4KfQ=; b=eSgmgMSoVkqXXxGGQOqsw5Gb9VtECeTU7Zdhw+HysaQGkZw+JPQ7GNja+SgIyQU00o N587ARe0BJxQ8r3w7kxUc0wtIgma13XdFPjBpBjjcOkj6MTnSgcaMbTCVe/jBsDekIB7 zFYegJUWjL1KjsAzbru8yfnRuOL2gh57KDE/J2fwkeOmpmW9jFMkQCll9f5RMGHgajvo 9RPV5naax4QSIFelej8MPCeNIJLISKgCBkqY/v5t7CWtwruttYAx9X567kDescYAQXcG vwTK/J2sk9BoZl/0hNuQg5k62wdqHl3SD3RLYX63e72nr9a0rc7Wx77LmgsLXhKdjRhS h+FQ== 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 e2si14777167pff.231.2018.01.22.00.46.08; Mon, 22 Jan 2018 00:46:22 -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 S1752094AbeAVIoI (ORCPT + 99 others); Mon, 22 Jan 2018 03:44:08 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:59204 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751365AbeAVInK (ORCPT ); Mon, 22 Jan 2018 03:43:10 -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 EF8B8F17; Mon, 22 Jan 2018 08:43:09 +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.4 36/53] Input: twl6040-vibra - fix child-node lookup Date: Mon, 22 Jan 2018 09:40:28 +0100 Message-Id: <20180122083911.905863191@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083910.299610926@linuxfoundation.org> References: <20180122083910.299610926@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.4-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 @@ -262,8 +262,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");