Received: by 10.223.176.46 with SMTP id f43csp2651860wra; Mon, 22 Jan 2018 00:56:16 -0800 (PST) X-Google-Smtp-Source: AH8x227EMWb35thoD2TPS7WPXUsFz1NXG/0LMrS1vhiJS2B3cBRcQrGSUousS24EG20VsAx1qGV7 X-Received: by 10.98.66.67 with SMTP id p64mr7779786pfa.227.1516611376354; Mon, 22 Jan 2018 00:56:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516611376; cv=none; d=google.com; s=arc-20160816; b=nUumIhp4OgdAnfa58teQBPO74hzfAh5IsOLguIJd7qlzbB4qB21+yfadCMKvbDBm+y 3y2Z3XfH8ZJqaQhmw8or+Jp08/MIqt+o6s+LbsjMobp0rdURw3ehaBJaOX+ZWgrJtoGR GTMLjIB/0glZgpHj4oPPiiqOHw0ZLlR2EFpRRIkZW+Jgpty0zqqDPFpMJ3UoXBJNJa38 BQNgw+Wc6VFUqhk4iGYy3YC0WmIbpMvyIsVS+MVPiOeQ5SPTcBplWNthc2plKXAtFGl2 WqIkTfTH+yRsbFLTNNcU4cAw1taZnUp08I/eWUbCTz1qg2+YGCve2MmeWoD1iIG1hFlo ITFA== 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=bvgY4W/N/ipAWyJY7l9zIiGtMDcKsiUI5Twa0usQF/4=; b=d7DSOzAVthrPdbLCY9uuJwUB8QSDA5DZVeLM1E+CD4m4FdoynekvNwFFZkc0FF4tWy OPOwTWAPKeMXWBqFvwEyDn3WMB6DI/0bFvPMgrVcZX1Dk8NBGYMspsAadULMEOCh3x8w /10NNdAdAdLvb695H4rSLSRUuRZq+wA9gzrq29lq+NKYBAhPnEIficrfIEE0GFnlk09N eVtZVgarLVVaSpjpzw082EsaBMTFTPBi2Y8FpDCLGIt/viuuq+Tzu4m2XUToDg6N7qO1 OkcX6BHSfjrEVhrUGmJP5Vp3WY8CTdqZ7oJIpH/ODUudCCGbVQAug2xJsyg0bNgGVeRe +5ZA== 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 d12si11682461pgq.658.2018.01.22.00.56.02; Mon, 22 Jan 2018 00:56:16 -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 S1753900AbeAVIyz (ORCPT + 99 others); Mon, 22 Jan 2018 03:54:55 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34402 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753882AbeAVIyw (ORCPT ); Mon, 22 Jan 2018 03:54:52 -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 14AB8F5D; Mon, 22 Jan 2018 08:54:51 +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.9 26/47] Input: twl6040-vibra - fix child-node lookup Date: Mon, 22 Jan 2018 09:45:37 +0100 Message-Id: <20180122083927.546413338@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083925.568134913@linuxfoundation.org> References: <20180122083925.568134913@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.9-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");