From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B83CBC32792 for ; Thu, 3 Oct 2019 16:02:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83E2321A4C for ; Thu, 3 Oct 2019 16:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118521; bh=h7qqrCFgfZ/DEQTk1JCp/CFiLubA0n8oC6DSbz2Bmhg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=RLhAEdq7jrzlwJmTNrjt9SrBPaInNuvwQ+8UAJAA5bRfkGDKCTpvR2ePf3DOqFz9b LqbgRMM+3L38stMba5rNyBatooQcACqwTGU3x6A3duJobF5vNtSbzSowhlRe4Q3sBt seczEbu/1bj1FWxSWzy79kSbq7tRqcP2QywXoRpo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731961AbfJCQCA (ORCPT ); Thu, 3 Oct 2019 12:02:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:46586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731947AbfJCQB6 (ORCPT ); Thu, 3 Oct 2019 12:01:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 17021207FF; Thu, 3 Oct 2019 16:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118517; bh=h7qqrCFgfZ/DEQTk1JCp/CFiLubA0n8oC6DSbz2Bmhg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0mSx9jpl9Se26RgDeciWpL5VxRRPYqcSxkiccqO/jDmE0FRAqRSYWiMLZ0IM5HBK2 rTi+VKo+2IMSkwj9HiSdpZ6XSpHN6WG99w2Y4M9S2EsRS1kB7jdpZDVVlJHa44zu5x w0fcmIRwNgbEHa4k+3qHM8DADtqlim0ZYIkS5bKI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Timur Tabi , Nicolin Chen , Xiubo Li , Fabio Estevam , Takashi Iwai , Mark Brown Subject: [PATCH 4.9 009/129] ASoC: fsl: Fix of-node refcount unbalance in fsl_ssi_probe_from_dt() Date: Thu, 3 Oct 2019 17:52:12 +0200 Message-Id: <20191003154323.127768962@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154318.081116689@linuxfoundation.org> References: <20191003154318.081116689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai commit 2757970f6d0d0a112247600b23d38c0c728ceeb3 upstream. The node obtained from of_find_node_by_path() has to be unreferenced after the use, but we forgot it for the root node. Fixes: f0fba2ad1b6b ("ASoC: multi-component - ASoC Multi-Component Support") Cc: Timur Tabi Cc: Nicolin Chen Cc: Xiubo Li Cc: Fabio Estevam Signed-off-by: Takashi Iwai Acked-by: Nicolin Chen Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/fsl/fsl_ssi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1431,6 +1431,7 @@ static int fsl_ssi_probe(struct platform struct fsl_ssi_private *ssi_private; int ret = 0; struct device_node *np = pdev->dev.of_node; + struct device_node *root; const struct of_device_id *of_id; const char *p, *sprop; const uint32_t *iprop; @@ -1620,7 +1621,9 @@ static int fsl_ssi_probe(struct platform * device tree. We also pass the address of the CPU DAI driver * structure. */ - sprop = of_get_property(of_find_node_by_path("/"), "compatible", NULL); + root = of_find_node_by_path("/"); + sprop = of_get_property(root, "compatible", NULL); + of_node_put(root); /* Sometimes the compatible name has a "fsl," prefix, so we strip it. */ p = strrchr(sprop, ','); if (p)