From patchwork Mon Mar 8 07:18:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 12121723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A197C433E0 for ; Mon, 8 Mar 2021 07:25:17 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62A9665146 for ; Mon, 8 Mar 2021 07:25:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62A9665146 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=VMA5xR8cXvgXneI0ecYRn/1OTIK+qv5ynuPMD7UfOaE=; b=D/EYF+2BUAIjXLEBwshU+Z2KZs 9GQO3f5nuNLCi5l6NimIN+/o8nudVO9nZzzmaQd4P6dYv+GX/PYWfqVTFSNjBVRZm78cMJSfqj8c/ rGBEiKRojasHngCOCQbzJU2MNlp/eKH053tbEsIeuhwbJBuIhqafxIPGtSv9+LThHgt+YjiSdQr9w kAjsaQQwHSX0fQ3CWS+nJ4AUAwHQv2oXouXeb37K3+l6H+CVjh8nw/aWHGr0LWHvhZkssqoq6E5gg 7mM8ze+EmnhcE83yq3iRm4hBTtA8xXUwHl+IJOkzD7ttuoGn+Q1pD/QUrHvgsUUgDB0RJuiyNib7n IIeo6gyQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJAEf-00FiBV-FZ; Mon, 08 Mar 2021 07:23:26 +0000 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJAAc-00Fh2r-04 for linux-arm-kernel@lists.infradead.org; Mon, 08 Mar 2021 07:19:21 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R841e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04394; MF=yang.lee@linux.alibaba.com; NM=1; PH=DS; RN=10; SR=0; TI=SMTPD_---0UQr502d_1615187936; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UQr502d_1615187936) by smtp.aliyun-inc.com(127.0.0.1); Mon, 08 Mar 2021 15:18:56 +0800 From: Yang Li To: perex@perex.cz Cc: tiwai@suse.com, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, Yang Li Subject: [PATCH] ASoC: bcm: add missing call to of_node_put() Date: Mon, 8 Mar 2021 15:18:54 +0800 Message-Id: <1615187934-39505-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210308_071914_824119_50F18C73 X-CRM114-Status: GOOD ( 11.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In one of the error paths of the for_each_child_of_node() loop, add missing call to of_node_put(). Fix the following coccicheck warning: ./sound/soc/bcm/cygnus-ssp.c:1346:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 1352. Reported-by: Abaci Robot Signed-off-by: Yang Li --- sound/soc/bcm/cygnus-ssp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c index 6e634b4..aa16a23 100644 --- a/sound/soc/bcm/cygnus-ssp.c +++ b/sound/soc/bcm/cygnus-ssp.c @@ -1348,8 +1348,10 @@ static int cygnus_ssp_probe(struct platform_device *pdev) &cygnus_ssp_dai[active_port_count]); /* negative is err, 0 is active and good, 1 is disabled */ - if (err < 0) + if (err < 0) { + of_node_put(child_node); return err; + } else if (!err) { dev_dbg(dev, "Activating DAI: %s\n", cygnus_ssp_dai[active_port_count].name);