Received: by 10.223.185.116 with SMTP id b49csp6401179wrg; Wed, 28 Feb 2018 08:48:38 -0800 (PST) X-Google-Smtp-Source: AH8x226DgX/GA5+9ZYFxzyd//eSy4GY0jbN2gqIiDkdZSApoitWwrP8j+NCnLcBEGEUU4cz0TXnr X-Received: by 2002:a17:902:7282:: with SMTP id d2-v6mr17702587pll.303.1519836518299; Wed, 28 Feb 2018 08:48:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519836518; cv=none; d=google.com; s=arc-20160816; b=e4CTzWj5aSsGXGTvh9pSyIMWZGv7WA/iUx6+fGGy+/E0Y9QnsVWA9z8xHfN4o+Acki AxUQVe1U8EEbOVUp90SJLPLysLSmaaB64FSB4H5QFdT0GCDiSa+v8kkqLpWkhkO6x52p x4SIK29xsrnQnQsSuAAlwZzN6GUHK0xedRg7WY7cgptS4l/JsYhVtUhQ+VDa8F/H6hNs GQ4Q1yl924w2g4hsVx1tkdL+yr71EOM/Dez+31ChvGgPMeB11Qvtz9xrf3wWHe4oyEHN 6CEgvwYuZYvjUFJHgfM6G4qQRlZIusmpLKABoDkHvnNwysFjETbVnjanx0dqXuarYlKq 3WLA== 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=lqi/Nd2opCD/P0kTQ0m6SQv4DRKWyvcfI6/wokoRfIg=; b=Z70SM3KOAI9SsZw4ymaXE6Ibid7yO0ac4QU+w80pFs0Of5otpUqmIoswRRhVVV7nKu Zz7pw4xsrgTRUAHHh38aU1r+1bktEWa4kdCHm89OZAoLcrOJ5JYGPX+4nGqLdBsjSMOC CdNBWEW3A33LfHhMBEdEaz/yf4d6vMOt63HMBi60fMa3LrqV9HWnxatjs7nDk9PKxi8Y 5FURMTCzvvOMW7A9U+aWf131AJPJ/UzUBE08AcvrDZtzbixWiNjMjdEIBxzOAhFEAS5T mDO+dh992RIyr90jS3FbsACRBMeLGNXWUocBHct16wXWhR4WM4HAuhRKiXY54GTKG8m3 yZ+Q== 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 l30-v6si1086800plg.346.2018.02.28.08.48.23; Wed, 28 Feb 2018 08:48: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 S1753330AbeB1Qrq (ORCPT + 99 others); Wed, 28 Feb 2018 11:47:46 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:34593 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934293AbeB1P65 (ORCPT ); Wed, 28 Feb 2018 10:58:57 -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-0006Xh-K0; Wed, 28 Feb 2018 15:22:28 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yj-0000Ds-5Z; 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" , "H. Nikolaus Schaller" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 187/254] Input: twl6040-vibra - fix DT node memory management 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: "H. Nikolaus Schaller" commit c52c545ead97fcc2f4f8ea38f1ae3c23211e09a8 upstream. commit e7ec014a47e4 ("Input: twl6040-vibra - update for device tree support") made the separate vibra DT node to a subnode of the twl6040. It now calls of_find_node_by_name() to locate the "vibra" subnode. This function has a side effect to call of_node_put on() for the twl6040 parent node passed in as a parameter. This causes trouble later on. Solution: we must call of_node_get() before of_find_node_by_name() Signed-off-by: H. Nikolaus Schaller Signed-off-by: Dmitry Torokhov Signed-off-by: Ben Hutchings --- drivers/input/misc/twl6040-vibra.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c @@ -264,6 +264,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, "vibra"); if (!twl6040_core_node) {