Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3022671rwb; Mon, 15 Aug 2022 16:20:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR69LEHq6mWu9Rjx0/s4No7YApvGO96kzGe9FC0XD44bvsrIWzx5h0pXLhv09NNMpjqw30jh X-Received: by 2002:a05:6402:35d5:b0:43d:a02f:cbfb with SMTP id z21-20020a05640235d500b0043da02fcbfbmr15784074edc.275.1660605608496; Mon, 15 Aug 2022 16:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605608; cv=none; d=google.com; s=arc-20160816; b=QqF5yJVESTCEuy08SS8IxR7FKbwC8rMdWyvzGe+/h4n8dkst0p8Lc/aEQBpLUSBUYD KV3yzyIfLwMQ1rJ+367y3KrOsLu1unjWAL7vnEaJljI8MeZ/hik357li05AWGBByzGk9 PAUU2++sRxPR/+NzPNMMndTmGKFnNlYk+W81dGvDkiExp0y0m9gsdXuBfcNQ6QiexFBj LdkVmfWPxL+5dqRk/Eklk49uex6tuaCdNQzStIjB9xXxeVhIJ1gOVO0A4tG4JI8MdZpX CjRolO6SP8WxfZO+5Iggl1272Av7S8QKNn6+oR18LDBQwseJVOtJimENe6j+ptvuTBip Lz9A== 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=9trnbAi2ezoxnKiwvbPt8tz5cE1gyI6MByOVZZYub5w=; b=DCXuSnZqMVBihTFJGA6QAEOxCghDQAXvu3KwWh7B8SsyYHA0oMOZaTlPtBnfa83Qe3 W6nMlx7UNxkaYXRwQfOx2OCRF5Ju6QdsHH5cbTjA1eaKllHzQxUMmQHGvVTPk+r3gBHX 7cYkTk74WPcCDZnjMl+guZyaAvqg8OQrkxGuLU2ljXM2MU6pdoROs9xTq6P/1+5l0FRr 7k5MMF+wozD/br7P7ec1C/s6tMvkbTND7ScG8EJkWZ4/6A2x5AgW8+YGI783wKExEQxt 8uGkioA0hxOZ3yvTWtjcVc3f6BxMc3IHLWSL4crsmqmHbpVwEjfP/oVPm3Zybm7/nEXY ZdoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yC493F2M; 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 sd5-20020a1709076e0500b007330a081f1fsi8537793ejc.679.2022.08.15.16.19.43; Mon, 15 Aug 2022 16:20:08 -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=yC493F2M; 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 S1351552AbiHOWsq (ORCPT + 99 others); Mon, 15 Aug 2022 18:48:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351870AbiHOWrQ (ORCPT ); Mon, 15 Aug 2022 18:47:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE1F0134BA2; Mon, 15 Aug 2022 12:52:59 -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 C346861178; Mon, 15 Aug 2022 19:52:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C849DC433D6; Mon, 15 Aug 2022 19:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593178; bh=DoVPNPsANI42njFz6pFTjfBTPpPa5wfXXRlQm9pBfy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yC493F2MkfJ6eWtJd2IbYL6p2qY9L+9vcAn30fg+q78S4TMcqUO1y6XBHZHSEVvYN Ym45T3krmuQnkWmftmWMEJ8NlCM/tir6Yw/0TLZYvsmf6opCVwK05M5SC6TwbW6p8f gL2i9kwTcH962ZJz0ABhDVFB0UOCkD3GZRLxtCgs= 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.18 0907/1095] ASoC: audio-graph-card2: Add of_node_put() in fail path Date: Mon, 15 Aug 2022 20:05:06 +0200 Message-Id: <20220815180506.817368388@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 8ebc4dd8250fd1cb5da2869c0fe6ae3686fe41e9 ] In asoc_simple_parse_dai(), we should call of_node_put() for the reference returned by of_graph_get_port_parent() in fail path. Fixes: 6e5f68fe3f2d ("ASoC: add Audio Graph Card2 driver") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220722141801.1304854-1-windhl@126.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/generic/audio-graph-card2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index ba3551d9a040..da782403316f 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -445,8 +445,10 @@ static int asoc_simple_parse_dai(struct device_node *ep, * if he unbinded CPU or Codec. */ ret = snd_soc_get_dai_name(&args, &dlc->dai_name); - if (ret < 0) + if (ret < 0) { + of_node_put(node); return ret; + } dlc->of_node = node; -- 2.35.1