Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2933044rwb; Mon, 15 Aug 2022 14:19:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Bqv72PkGVogixnTErE4tKYeM81BgThuWBeiNRyg27utSkWf0LDkl9k1xKi+PtW2ATol4c X-Received: by 2002:a17:902:ca05:b0:16d:cf59:2aff with SMTP id w5-20020a170902ca0500b0016dcf592affmr19292433pld.105.1660597993118; Mon, 15 Aug 2022 14:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597993; cv=none; d=google.com; s=arc-20160816; b=ekODoSVHB7nrPP2clUy+RVEB0GXvdoa9byLAORroxJX8HEpyZLR4EJ9LWrc58YLgqU T3ULCvoPEvQOJfNjL8Ct7QPC5BHbpEZCtrlllANOElxUimc1SsnTPAZyzlhqqTonfN6M a9eDKIRpoVXPZb9h/My/BG6b8+9BWH2AyMjc+dgJQyGTDFOWA5U56adCW6lFe2yXrfiE 3lSgj/epH3orNKYGQCSd5T30ygpYwWXejaRt05QEk2DOJS08xfAGEMKgFxUxO3YPAMpn AXOVf8Kgj1UeS9EQQ6wrm6ARqH2ppTJ3qpwN7Spp73vEpU76oA+ofwJMTVNlzrwLE8eY UmjA== 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=sK6V0+Y1SUiM5/iU+qA+vY84IWqvgsS3MSYkScp9w+w=; b=urTSZ4pZ9g0iq+rbpRTkVHJZs+FXPY0a9+8QZQ2wPpqSuVjgIjgtZEEmKurtaG3J7w H9Bo+SCgzY6FG7Hav1wYd0Q/OPEMvJe9nMzLnVQxiQ9b1j2XbeaJi1aZ3paa8Gg4zDLo QcV8wTvIQ8Q9JeDY0JXBmbfz6eaR68tiMQSQj560RVNzvkwbf+Cd63jPDKUTELRhSGhv x/IwRC0NrhFbYvVm0t4DWUUgQb40SeUxIn4v3diU7R2wJcpoUxIFbsFKZ7Vq2XEv5cwr 465vVMFFsiglX/w9+f45/sYCVqxDp/syoQM2OEVpFKRHAsd7sdbF5zxtLdcaHKSYMGom goZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YFOhygoV; 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 c2-20020a170902d48200b0016efe8d827esi13538168plg.154.2022.08.15.14.13.02; Mon, 15 Aug 2022 14:13:13 -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=YFOhygoV; 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 S245535AbiHOThZ (ORCPT + 99 others); Mon, 15 Aug 2022 15:37:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245740AbiHOT30 (ORCPT ); Mon, 15 Aug 2022 15:29:26 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2F505E324; Mon, 15 Aug 2022 11:44:03 -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 sin.source.kernel.org (Postfix) with ESMTPS id DE11ACE126A; Mon, 15 Aug 2022 18:44:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAF5FC433C1; Mon, 15 Aug 2022 18:43:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589040; bh=pqbpWM0ovuucZKEV5C40+B3/2rDpOTNZlRfpRdD2Tu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YFOhygoVRTUUevZ1PQyqt+Uj3mkNc/beDgC/4vC74CL9U6U6On7/1tfiozkCc8gnN dAs4Yg5Tt3UvNWGB2IraH47rfr86s37djDr8Q2fiFii01U4xubGu9uBVLny84t8amL HB0Ecjeo/skQQ6eHOAZ92Od0FJOXxKCPGxLOzKmc= 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.15 562/779] ASoC: samsung: Fix error handling in aries_audio_probe Date: Mon, 15 Aug 2022 20:03:26 +0200 Message-Id: <20220815180401.347902834@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: Miaoqian Lin [ Upstream commit 3e2649c5e8643bea0867bb1dd970fedadb0eb7f3 ] of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. This function is missing of_node_put(cpu) in the error path. Fix this by goto out label. of_node_put() will check NULL pointer. Fixes: 7a3a7671fa6c ("ASoC: samsung: Add driver for Aries boards") Signed-off-by: Miaoqian Lin Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220603130640.37624-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/samsung/aries_wm8994.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8994.c index 83acbe57b248..a0825da9fff9 100644 --- a/sound/soc/samsung/aries_wm8994.c +++ b/sound/soc/samsung/aries_wm8994.c @@ -628,8 +628,10 @@ static int aries_audio_probe(struct platform_device *pdev) return -EINVAL; codec = of_get_child_by_name(dev->of_node, "codec"); - if (!codec) - return -EINVAL; + if (!codec) { + ret = -EINVAL; + goto out; + } for_each_card_prelinks(card, i, dai_link) { dai_link->codecs->of_node = of_parse_phandle(codec, -- 2.35.1