Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2163228iof; Tue, 7 Jun 2022 21:51:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzq7ZhuYK/Yxw1r/Lmpkh376n2YF7D/THF/frbRm4vxdI+fnxAH2NWgfWSMRiAAa+OYR49B X-Received: by 2002:a05:6a02:11c:b0:3f9:e159:5fa5 with SMTP id bg28-20020a056a02011c00b003f9e1595fa5mr28406877pgb.245.1654663894213; Tue, 07 Jun 2022 21:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654663894; cv=none; d=google.com; s=arc-20160816; b=hEmOXU9dM/BwlIkzPbJYzwz3sIlaZYINNB2kOm3+azvXnXJuv1f2eGhal9n9a00OS7 80+CFcDqZsPh1E63ZryCG0JUP9SJcoaVbBh0872JeDRl2oKSZK148sAkB7mQy9bybVHB 5tEciwgRoSQ4QN8pDXGz/ZAoZknH7df0zYbm4ZR0HXt+FC/6kqxwvf6MvF+z0o3wrU8N v3qvUJzw7hs7iu/zLQwgAC1CmVu6ww28st+iMQhT+kHdDNSlXWGgxYODj7Ub3lfyPw6Q arnhVdvCFA+vrZJZ2hnYm+9vBwzdYXWT+9UuzZ1lz1AJpcQJGEOcu3DqozlZINCE+4Ds 2zyQ== 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=dbhKIIaFiSrAwWM4lnVrfjScyXTPKwzJWMKXQQRA30Y=; b=loP5v4saSnLPo2bQo7QNcYN+tPVBSy0nf+pS2LwvZ1d8QBj8mKm1c6dZgNCFocZFso 9mXnOjiV7TX+W+QsbOrS6iiABVelNNW86/1ut01WF1d7nbs4slW7tctH6Ib50olHMccY Hj1lreJKUfASc9cp07j9dMugaW9MfmBhY1JZA2A4bfi8leWZ50o9BOolX2gfFob6HrdF rkVDfJMAOyDLAg/7Z2om1f04zt0dZIQVFJ0K6AfAPABb+iRY962B+SSDx8QekWF9zPRD uAufDGdntFWeczK7YbjzSwJxB3V3NKlWDCkOcfOHQmwJ3kA5Avmod1RsCvIYP0U7yQ73 5ayg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="qn3Ww/GR"; 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 b1-20020a170902a9c100b00163be809240si25726409plr.302.2022.06.07.21.51.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:51:34 -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="qn3Ww/GR"; 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 7817A3125AD; Tue, 7 Jun 2022 21:21:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244787AbiFGRsk (ORCPT + 99 others); Tue, 7 Jun 2022 13:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348130AbiFGRbf (ORCPT ); Tue, 7 Jun 2022 13:31:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DFA11157EE; Tue, 7 Jun 2022 10:29:29 -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 10814B822B0; Tue, 7 Jun 2022 17:29:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 700B7C385A5; Tue, 7 Jun 2022 17:29:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622966; bh=vf/HxcC0bSo+zVL8D7b6Ki/cdRioCqznL6rtX/zg63w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qn3Ww/GRAKsgvv4dqhWg90/O7WJcbtj2Qn9vLmzSn8hyaKkfqGaAAnBJosXvHLJ0o 1YPw7n767ihZyJ4YDWom1snAnkI2pUMfclIsedOUHltuRwTRV9D7SM5q8dHCGKRd/I iqPD9pjVq85pB9pISkz+I5tFzYQ/mUK6fzvkE5uY= 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.10 206/452] ASoC: samsung: Fix refcount leak in aries_audio_probe Date: Tue, 7 Jun 2022 19:01:03 +0200 Message-Id: <20220607164914.703324084@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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 709336bbcc2f..18458192aff1 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