From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x2271AgSHKBn8ke2IUAvp1JGu3DtW+I9S+Xxe0fAibOkjwZog9Eq/xFfMU9v8EZpxp5rHpkuu ARC-Seal: i=1; a=rsa-sha256; t=1516611230; cv=none; d=google.com; s=arc-20160816; b=cZoM/xJgJPR4JqdVNzHKnIm2eN103jzK2MfXnbwYnfaApnM5+FpPapmNweVb33yJZC I1WURJcsd9tyvU6/QR+ZytyHenT0JRdnoPgHWX54lgp0xdPOMq4mui11DJV+NLSH/Sy2 QqtA0gr1fyecSh6dMInOsyBolPnfL9RaVRvYAcUFBdzW0ywVvK5NCvG+bXVUIZrP/Oeu Iw9O8mvhBXa4zvJhzKz4U4yNZ2WChmvzp/lylD9g0lnoMKYXq4vQinTFybbx1vtJ2+Ld mN6OQGd/Dfzwek0pLdI4mgAtsMoePjBx1VL+pk+fn+TeCzwkX6jFNhCd38eXcw7fmk93 bmig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=YuP3lTR3XoVY2D89due3o+7PmEElMYkFptnsp+p79sk=; b=r4k2BHPYf30WCB4j+YKqr5tGkPHnbrvDbHSoepgtTHlgC4fcOa54qwPxWG36jwJUou oEt4czkAv/D4G0rIYpVHJo27bUHQSpG67TZiRHW66KirLmAC3A4s3njtv3F162mOp5EA c+H0e0GWiHp5Cy7NT2YfjAymHcRicuamMZndvIs+DRNNYJQ1TM0kBtMb2lNtBtN0kzkx JLRlHPswxWZyaZTEVpZGw/G2NkyydwgyZRVt4JgBTW5gjNiMmuXl4RQ3K3qTtobaqckt FoJgRcaia++KrD8vOAw2ZGcqJP6/m5sJ/Y/uMbFyFdIT6Q5nWtelmAltiFEnb0/V38tH wnug== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281467376099961?= X-GMAIL-MSGID: =?utf-8?q?1590282137087597362?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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");