Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3250465rwb; Mon, 15 Aug 2022 22:18:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR5XinG0bxBNNM9tCoFxtXU6sXeoTrTC7sJkAC9Ej4t/nrB6npiZYRwT0g+iPrjAlaPAZDmr X-Received: by 2002:a17:902:b184:b0:172:766e:7f35 with SMTP id s4-20020a170902b18400b00172766e7f35mr4548053plr.174.1660627125103; Mon, 15 Aug 2022 22:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660627125; cv=none; d=google.com; s=arc-20160816; b=k2X6gO4w7fv01H+vPQy7GpRL0GE1dqYLqpSo/bqim/67XnnZGeACzjqtYaElA9FdZE O9sNw0kHsASDO7luYUtS5saHF6iBHx8hvJIUP3pzDFmnjyN97MB8aqnIz9EUXz5HsLmB b0HnJT8SIvqO69fpxNACbFLkQTC24nn5WiQB48jq8cYW1G6tJ7p5HYiIGO9n/vzH/7nk GA1w63Xkl8JBIazH0J81IpUOe87JsMYRkYovJGkmnDgDriud0q8+4xQnQ5hiF1r2wLy6 uarzW27QShbIHnV1BIdfPStflJZfuH8xFaJM5Vk//Rnlhhyjl7u8aihUoCvBFGT6AmSO 9aGw== 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=Q0hQlLTPffts9eSP9qnKKpySEp69oTsw6K7mZjRRB5Y=; b=Wl2S2USfZVjAueFXt78DR0m36JGN5IkjtzP8jlaihpssIqc3eKPufI8yKXO/XU66+F LOShdn2shn5wf0vCkrN4OoMm4d18skXZSInE9DCUL7kr4qCBS/IrXtf019GPdRIKxbEO J6X0KQ85CVqVyMK3widAam34fLUrl6cCbPMeaC0lBUc2lW08UyGKBwDir8CERnYmDNo3 BPvugi85fc6j1WM9VIo+EbejAy4p/KgSLxxtwyf7JZ/E4ce5bK3AmDeymZdZRn8hMkMG Xn91ENr3hkS+245K+fKqgQnY0S5fF07ZGDmVv1UBVKzxRoIfVwtC3UZEzi9K5fp6qVhG rWtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xTdct0Ya; 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 x18-20020a17090a531200b001f52b9da824si16544502pjh.113.2022.08.15.22.18.34; Mon, 15 Aug 2022 22:18:45 -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=xTdct0Ya; 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 S232542AbiHPErQ (ORCPT + 99 others); Tue, 16 Aug 2022 00:47:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232207AbiHPEo3 (ORCPT ); Tue, 16 Aug 2022 00:44:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C318FD474A; Mon, 15 Aug 2022 13:40:41 -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 4D95261227; Mon, 15 Aug 2022 20:40:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 392E0C433C1; Mon, 15 Aug 2022 20:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596040; bh=/GN2McFEFrqmD4oj0q4LhqCpEV0Mj45kxZjeZZwVXRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xTdct0YaJvnQhz+imovyO7SY/UgIu/qfFoLbgZOEZLHp8uCY7gWiFL+8sYH7Rbqkw I9uPp/hshZl/GtlPg6zAfod5rlEMx4q6GUXCZC1Fwu0ouAq4d5HHXddHgsGf+6WpCz mjrppmhh94Eblpf5Rtaj58waIBpTUTVMFYepGVw4= 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.19 0954/1157] ASoC: mt6359: Fix refcount leak bug Date: Mon, 15 Aug 2022 20:05:10 +0200 Message-Id: <20220815180517.774632970@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 23709b180409..c9a453ce8a2a 100644 --- a/sound/soc/codecs/mt6359.c +++ b/sound/soc/codecs/mt6359.c @@ -2778,6 +2778,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