Received: by 10.223.176.5 with SMTP id f5csp3442386wra; Mon, 29 Jan 2018 13:14:38 -0800 (PST) X-Google-Smtp-Source: AH8x226ApjDLzNgE76WM2GSiSGReaznMnzkqWHQwEfQRlgFX1gBA/GX5xAaLFtyLOQd/gFME58E8 X-Received: by 10.99.97.69 with SMTP id v66mr23310173pgb.307.1517260478667; Mon, 29 Jan 2018 13:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517260478; cv=none; d=google.com; s=arc-20160816; b=MrO4ET3TsJZHA+7Z0qMDuSrFYNMYQfnYbZSYpLQi5w85TVYoTunIG8OyhWDUdbgRBc il2+TnDH7/3zlSQeSgYmpX57YehSg/0c51+BBYMBoG/b02URMlAf3Z1/cyifKUYKRNbO lCwBMQfUOq7eXYJDseEm8WFIljWQ2Mki9konI+0Xsgu5UWj5keROSajSLmnDHBFSx/fl rx87rQWAprxvhnEponTH/5HS15jzLRp7q70e4h6lo+soP5fVeY0qbnaI8WNX51QJo16a SRRmc3X/HAacTrSP3mRgcyqGNGLJ9N/ULZ54ZuWWdDj/1P1HdT8FGgBt586+NSXzqrtO 0rTQ== 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=6vfmejDOYL1JN8Zje5+TfwXo4/6heTDZNeURcxzWEx0=; b=kIaY2CUiLSAcHYni3iynVlM3BCsFhWq8wFSTAcKCZQUxhVEzeBoC6rGJu+KadBC5na qGM4MO8u049C7NODdfyVKd34Rlkzl7N9EG0OAsUQhPOY1KdzC0lX6mJ1qItDocDqQPDx 1OHVdD4LLKYgVXp7+uJwWYQv7mrLEnOfoLFdOAZ/uwkNjWWBvAb1aZdd8StLHLWJMsao wT2Beq7eWO8tWUs/L5/HVFzOVNb5pBpb1zTycVKEowQ0USHBW+yVVO9pmwvAYTYh+34g 4Q1q3nCg7SFxapRPA0rWpNcYUp8enBftdU1sAHWH54jJ0gpXqRtCEY8heYbIkf64N8d2 3yOg== 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 f1-v6si433575plb.566.2018.01.29.13.14.16; Mon, 29 Jan 2018 13:14:38 -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 S1752464AbeA2UFE (ORCPT + 99 others); Mon, 29 Jan 2018 15:05:04 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44564 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752445AbeA2UFD (ORCPT ); Mon, 29 Jan 2018 15:05:03 -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 689DE2EBF; Mon, 29 Jan 2018 12:59:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Dmitry Torokhov Subject: [PATCH 3.18 13/52] Input: twl4030-vibra - fix sibling-node lookup Date: Mon, 29 Jan 2018 13:56:31 +0100 Message-Id: <20180129123628.767799173@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123628.168904217@linuxfoundation.org> References: <20180129123628.168904217@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 3.18-stable 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: Greg Kroah-Hartman --- 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;