Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2122078iof; Tue, 7 Jun 2022 20:28:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYxG6WE4vYKURMlpCU63BCOBOKcK6Gm77+Gvvz/A39tU9jajs5sqHJbMmPf8BeEd1izeW5 X-Received: by 2002:a17:90b:384d:b0:1e3:1266:d378 with SMTP id nl13-20020a17090b384d00b001e31266d378mr50398766pjb.127.1654658888860; Tue, 07 Jun 2022 20:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654658888; cv=none; d=google.com; s=arc-20160816; b=nRAYRrspQvu9kUxDTcwhnjtYp0oOZQvAoNI6L1hC3+V8xW+7dXEabheXdx0paFXU0O O7NIPat4GsZczS/P1mh20TslyCCOm/0KheGMYkdUg5Aq5XnrImEdzbM/nVu9C9r77R/Y BtNXNL4LzKcL8hpKEHn1XU7wb4quZrQfjdgirhCJ/VLtZLbesjhAsjgCW3i+uSP8DwsB aTq12g7nPJxdT8DPWVR9tsoPZp675DGUZxXO+eCc2DFKb6W0rorr7yAVcT9mIp1ndR1x hTjfncAmaXSUbvlYvFYjbEGJ7b7khc2JzbFZDvUzMTf6sxc1HU03PUGrNS9aYFe2W8/4 I+rA== 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=JttFz8RkTLZ9rwe1UWTxy7pO4kFf+IrhyPm4o2Z8Mq0=; b=A2eOSzpTCl51Hm+PEHZTaxr09vY9vXO6s37x77uTPNzWRGab/AaYzAi3hJBprGYa+O FTmcVLbJwX2Y1Z3hFHy1LPahaBOv91GUVhPVEQXFtWw7Y+ubb2Z+Jl/kwAAJpHnp1MBT Sn4htANNIrNOgdXbOPwnCgfi/jEVCYpramUOAhlyvyzgSDpad351cJu4ghFalbXadZoT BhPF525IuEHXakIXKxQssNarywjydL53NEbjhytcgvUNr9AXp+6125RT6Gzrm7Cql4eh rkbI2oS0cjPKvNSv2rUIp1kUBCWqq9eY0xmfOWpxNdy0afEhzOus7RQOaNodlBhSbTHv U5Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=odDAOy5Q; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v64-20020a638943000000b003fc61e0fb47si25762952pgd.799.2022.06.07.20.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 20:28:08 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=odDAOy5Q; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 36E4013F4C; Tue, 7 Jun 2022 19:48:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385764AbiFGWqj (ORCPT + 99 others); Tue, 7 Jun 2022 18:46:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381141AbiFGVgd (ORCPT ); Tue, 7 Jun 2022 17:36:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1899814087F; Tue, 7 Jun 2022 12:04:58 -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 ams.source.kernel.org (Postfix) with ESMTPS id 85961B823B0; Tue, 7 Jun 2022 19:04:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0DDCC385A2; Tue, 7 Jun 2022 19:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628695; bh=ldGhd7bSBWMTDEq9RvkJwTdry4k2qspt5cCyIwrHyVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=odDAOy5Q+GORoSe/DdlY2JYPaqLZa+DHLsl+asNtyackLQL4r2uFCILI2nyC30fZz W0KPbSbRdXAClePrh5z6gqz3VzIDQg1yL3UDUCfGn2rxC/UNs29/hmk8VbOXkCZtRV T2vcjbn0WQcjPwdlMsXVI3QaOdUcGVSTXtauQjeI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Krzysztof Kozlowski , Mark Brown , Sasha Levin Subject: [PATCH 5.18 423/879] ASoC: samsung: Fix refcount leak in aries_audio_probe Date: Tue, 7 Jun 2022 18:59:01 +0200 Message-Id: <20220607165015.144184549@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Miaoqian Lin [ Upstream commit bf4a9b2467b775717d0e9034ad916888e19713a3 ] of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. If extcon_find_edev_by_node() fails, it doesn't call of_node_put() Calling of_node_put() after extcon_find_edev_by_node() to fix this. Fixes: 7a3a7671fa6c ("ASoC: samsung: Add driver for Aries boards") Signed-off-by: Miaoqian Lin Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220512043828.496-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/samsung/aries_wm8994.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8994.c index 5265e546b124..83acbe57b248 100644 --- a/sound/soc/samsung/aries_wm8994.c +++ b/sound/soc/samsung/aries_wm8994.c @@ -585,10 +585,10 @@ static int aries_audio_probe(struct platform_device *pdev) extcon_np = of_parse_phandle(np, "extcon", 0); priv->usb_extcon = extcon_find_edev_by_node(extcon_np); + of_node_put(extcon_np); if (IS_ERR(priv->usb_extcon)) return dev_err_probe(dev, PTR_ERR(priv->usb_extcon), "Failed to get extcon device"); - of_node_put(extcon_np); priv->adc = devm_iio_channel_get(dev, "headset-detect"); if (IS_ERR(priv->adc)) -- 2.35.1