From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x227qqv+85m8iDweSctKag/cySJcZRvEG8t6xmASyIkichtOk7tgangSeF/QYtSPE9QuB4D32 ARC-Seal: i=1; a=rsa-sha256; t=1517256931; cv=none; d=google.com; s=arc-20160816; b=zLWDROlEd09ROiAGLdxH2c5BLLKVgeJvr6s++UyMfEdrDesgAQGS55eJC/GGlmeP1C FfQduyv90CpjXq5CexfzkW6+LKag3/YIsIpVUEH/NuyBYCxfe5NK2p837mF1PdQaQYYn Ctg6zsY+9Pg6gYCwVAxzGS5NZhGdS+rU00CZipl7qDdEeOnB4274hm9Qwh/oCcmNWdXR xpvo0fRkozPA+aPlMF9DKMoOcol273ouXoAg8TbZ3BMviBGDgVg9y5amfVoR/7Umdtwr tFA2fUS9HKU2ZP2YTnIB1iY36za4dEe9U2CmFhTczZyaiSWJCw3yc1CTL6K1gb/690/X F7qw== 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=z6//8KstnRpPQUh5ljc82oToleIb5uIiVFA1qU8pNAE=; b=OWXguz143FZtvzecEgyVQ4ti7uOsjRl38qk/Ol1KddQcXN+dvU6ZPtMEhVtzivnfja /5vw8B9ozduVL2DGRQl6SG+BV9VSy0Op6x9eqff7ww23qFfNgTS0cGaxPZjJjWA/QM6e ebSJdrLERBWawkoy/gPvctO795DdqjvjmyzuJ5XTjFYocGgAFR3+kdofbwxq8ehcEE5b mSoAgt+0fm+nZrpp/tMGiIIbP2Riw+Nx22gHQUeDqMWSf2GpdDfP1cldoxdqy57gid3f Ud3kwM1o//DghBTFK/uN/PUgs8kA2Y1nFv0fQwHmulsiVRAt+h6lRkazuy0egYWw15v6 fxfg== 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, "H. Nikolaus Schaller" , Dmitry Torokhov Subject: [PATCH 3.18 10/52] Input: twl6040-vibra - fix DT node memory management Date: Mon, 29 Jan 2018 13:56:28 +0100 Message-Id: <20180129123628.642315133@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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590959204058321929?= X-GMAIL-MSGID: =?utf-8?q?1590959204058321929?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 3.18-stable 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: Greg Kroah-Hartman --- 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) {