Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2883719rwb; Mon, 15 Aug 2022 13:16:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR5J6wHTEGgTVcMLsVDAvgbLK6LfPz9kNBEJF5Rr2QHmOzFXqbOmvSb0J95ynOruuKqNLPc3 X-Received: by 2002:aa7:cc06:0:b0:440:7258:ad16 with SMTP id q6-20020aa7cc06000000b004407258ad16mr15545362edt.74.1660594561673; Mon, 15 Aug 2022 13:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594561; cv=none; d=google.com; s=arc-20160816; b=1E7DbTXKL0eyCuZHEW6/HifjJBbY4hbA2tkDPW853X+OML/i0u1gwrA67RVDGWjsMA HJ2Jq/GIj/szCwKRKIl19NldGIFlL9IZ3M5EywZz96fvBg9mfo9h/Z+QHpHbZI1e7Tup w5RgFZbxbnZIRho4edV+z55FIl17Yk+ls8dzignmyf4tY9Dh0jnP0gbnYQFqYE7pLNzA il3+44kox+ES3Yx7wVyNFyhfr23dBLhI1PueNebuCXvsA05EDMC+w8GYL8ZP08AHGC+M CirimZeixNPYKS5xmgXp+Da1wLS3AqDhcfW6EtX3F7Z5pvY+0W4g5oHhiMmFKPZK4kSp yhEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=THXItFwB1ZKfwGBGbSnAVFX4i27t7lAhvXEdYMv6Yi4=; b=jdzhqmAUtJbcYRgPHk9lvz5P8PoU+6R2GMIILaVK3kSDiaq9MP8ynEQPziQueM+ed1 43glJXu1VhoOCdMxKeli8NiSj8dTlL1tx2YF/EfRKfWpf3FDAKFddAcRqz44QZKOr8bG mc3Ud0CrcXO8k0x7ixnSB9ZHkMtvSPJhCIpPUlGdQW7r9ujxgXIO3nFTsNyibYrVLnt0 vTJEiZ/CT7Tv5avh/uFGuC3dlfyXltAHSX8DSR8fLP9FM4TyYkGGM9TrdsnCgDUToVWh qvrg09ez7JqvzMEpp+rZLMtXSpDzUecFTke+f9qEa3e6SKxWIc5kIb3Ti+Pu+taVZaB5 49AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x9+NAtGD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m23-20020aa7d357000000b0043d1c347df3si7681932edr.152.2022.08.15.13.15.35; Mon, 15 Aug 2022 13:16:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x9+NAtGD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343800AbiHOTjw (ORCPT + 99 others); Mon, 15 Aug 2022 15:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344380AbiHOTgh (ORCPT ); Mon, 15 Aug 2022 15:36:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9E60642F3; Mon, 15 Aug 2022 11:46:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 95876611DB; Mon, 15 Aug 2022 18:46:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 969ECC433C1; Mon, 15 Aug 2022 18:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589161; bh=5SpB8uOR+chZgRcrC8jOsqoAakLPmR2ieEX9GHWy0ak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x9+NAtGD9g21B6V4lGcO8SP9mjb+m4wGVuznakZ1zj77gp4ePGlq+tm0koLT5Igku +fppAzZ3c6NM54zF4v/Nq8FkT+7RBlaaxqAMzWPUgY95TgXAVgzKb+j4eFI5TtdZJA 6R9QUTy9D0EO6iMx7Jik58GwuaLi3Pr7VX8rP4Cc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Mark Brown , Sasha Levin Subject: [PATCH 5.15 601/779] ASoC: mt6359: Fix refcount leak bug Date: Mon, 15 Aug 2022 20:04:05 +0200 Message-Id: <20220815180403.052918259@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liang He [ Upstream commit a8d5df69e2ec702d979f7d04ed519caf8691a032 ] In mt6359_parse_dt() and mt6359_accdet_parse_dt(), we should call of_node_put() for the reference returned by of_get_child_by_name() which has increased the refcount. Fixes: 683530285316 ("ASoC: mt6359: fix failed to parse DT properties") Fixes: eef07b9e0925 ("ASoC: mediatek: mt6359: add MT6359 accdet jack driver") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220713102013.367336-1-windhl@126.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/mt6359-accdet.c | 1 + sound/soc/codecs/mt6359.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sound/soc/codecs/mt6359-accdet.c b/sound/soc/codecs/mt6359-accdet.c index 6d3d170144a0..c190628e2905 100644 --- a/sound/soc/codecs/mt6359-accdet.c +++ b/sound/soc/codecs/mt6359-accdet.c @@ -675,6 +675,7 @@ static int mt6359_accdet_parse_dt(struct mt6359_accdet *priv) sizeof(struct three_key_threshold)); } + of_node_put(node); dev_warn(priv->dev, "accdet caps=%x\n", priv->caps); return 0; diff --git a/sound/soc/codecs/mt6359.c b/sound/soc/codecs/mt6359.c index 2d6a4a29b850..cf1febe54bcd 100644 --- a/sound/soc/codecs/mt6359.c +++ b/sound/soc/codecs/mt6359.c @@ -2780,6 +2780,7 @@ static int mt6359_parse_dt(struct mt6359_priv *priv) ret = of_property_read_u32(np, "mediatek,mic-type-2", &priv->mux_select[MUX_MIC_TYPE_2]); + of_node_put(np); if (ret) { dev_info(priv->dev, "%s() failed to read mic-type-2, use default (%d)\n", -- 2.35.1