Received: by 10.223.185.116 with SMTP id b49csp6406632wrg; Wed, 28 Feb 2018 08:54:44 -0800 (PST) X-Google-Smtp-Source: AH8x2266gXoPGe8KEPI+6YUz3yhhtLXW3kApv92WVk3UuPYUsYJYll2+8NWC6qr6/c0A/dzANySf X-Received: by 10.98.226.16 with SMTP id a16mr18156696pfi.157.1519836884388; Wed, 28 Feb 2018 08:54:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519836884; cv=none; d=google.com; s=arc-20160816; b=NBW9i8h9yDg+C/ub5k3E2SEif9WPuISkq5l5BjPMLqkytnR3JBagroii8AzkcoZZiA 5587bvQ9NEgJwFKZ9Ab2UqNEh//7woe72E5RkdjskEkJLQN/kwo2MDNZl9846pvfoXGX pZuytsFhOsgJGx/Numc8n+5SxImv0q50E3fU4CUHCyv+AKqmkhDSugQOvXgt6qgvV5sg hLuf8/pIUK42l3zIiBqgY2Tj+b3qsSgwhClFt8qn4G2CA8SxK0zam8h4/1yt3lFKysqi bofCPD9tvpoG+xFQTfP6T9+DqCNsn8NepPQpIF4nJyfdAYZxcpaOO+tqtMmZtF6bTjvg dvJA== 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=oZtyL762pbCke+S6eelTuPLgzXTELDs0dJx3auV7XrY=; b=U2Y37Nur1vWnqHqd0RRjXqMqW1lAj5NcSAaUErGwU6ahum6UBWR7MFOivoRdLJUXiG JGCC4CtflXwlV4jFnlIQr0777glmhIeLtZry84wEHOx5/xIT3UAyCPOMk/boL85tp1s2 aat08JznDQt4r7kE/4EQQqxRZJpphOZld+9pMtpRrV/MMQo76zPlNjpa62tcomD0J+6F b5wMcFMBqZe28vHCetikz1hMkknhYHKU2wHUEJR+Lw8mh0AE7XBn1cEYOs5DiaSw5+vL PaFI7vZt+2EmJAnQkvQ8355AEn5WYjzESQOXTfOYTMhEJE/vHIPC0uB45thM7fWSEQ3Y TA+w== 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 s9-v6si1526780plr.57.2018.02.28.08.54.29; Wed, 28 Feb 2018 08:54:44 -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 S934223AbeB1P5z (ORCPT + 99 others); Wed, 28 Feb 2018 10:57:55 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:34529 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933979AbeB1P5x (ORCPT ); Wed, 28 Feb 2018 10:57:53 -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-0006XQ-OL; Wed, 28 Feb 2018 15:22:29 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yj-0000Dn-37; 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" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 186/254] Input: twl4030-vibra - fix sibling-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 5b189201993ab03001a398de731045bfea90c689 upstream. A helper purported to look up a child node based on its name was using the wrong of-helper and ended up prematurely freeing the parent of-node while searching the whole device tree depth-first starting at the parent node. Fixes: 64b9e4d803b1 ("input: twl4030-vibra: Support for DT booted kernel") Fixes: e661d0a04462 ("Input: twl4030-vibra - fix ERROR: Bad of_node_put() warning") Signed-off-by: Johan Hovold Signed-off-by: Dmitry Torokhov Signed-off-by: Ben Hutchings --- drivers/input/misc/twl4030-vibra.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/input/misc/twl4030-vibra.c +++ b/drivers/input/misc/twl4030-vibra.c @@ -180,12 +180,14 @@ static SIMPLE_DEV_PM_OPS(twl4030_vibra_p twl4030_vibra_suspend, twl4030_vibra_resume); static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata, - struct device_node *node) + struct device_node *parent) { + struct device_node *node; + if (pdata && pdata->coexist) return true; - node = of_find_node_by_name(node, "codec"); + node = of_get_child_by_name(parent, "codec"); if (node) { of_node_put(node); return true;