Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp324563img; Tue, 26 Feb 2019 00:18:41 -0800 (PST) X-Google-Smtp-Source: AHgI3IaipUKBtyreRjcheLFWVx/A+QFEKf/XBNHw+REe45IbjOkZDUd4v29+DW7G90uBG60JQq7L X-Received: by 2002:aa7:924e:: with SMTP id 14mr25112530pfp.30.1551169121253; Tue, 26 Feb 2019 00:18:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551169121; cv=none; d=google.com; s=arc-20160816; b=g5r4eHNUdq6BVJeK0m/oBu5LmxKu/psdZVsrHh3MJFdw8bGphXzwUhhD0CTINSBpbc QfNnlXUACyMn2DNnmQn/elHG46UslQJjqkeB9bbyG4hpkUF7EEphBWk15phvvdVXZMhq paYLjFBkGzgzwrHS3dhocKNstMyO5Bmyc6cJD7oAKIARCfbL36W5SVX3G145lA59lJQD beFZdlZuLinCk/ZKSB59x6CCFGo7Ni/ZxlmNa6JsMmNdbuoUGNTQif+oitWDAnlXDE4+ leoJxqVeWQps2pfv1pNDfiQ3FKaY5M0EDdcJkpP0+BAatGW7AO/A4h9gtjGwNzAcMdA7 2ojw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=k3lDGyMTQiOkbrNLQw3VkZUylLx8Xq7Cm4qQs0wH7Mw=; b=fsc1+XLrm+tc4L468BdFvdwryiBGQ+D/4qqloFZ+OkZ3W9wnVYulj6kLJFbjNsLIMy N9OCfDQlMUnFjzdHfbu2SDSVBCcrPpFuac5Gd4dlOHByN2PlG5SqO2AW1xEjpP7uJLeo QD80tSNwqpXPyhR8F5IDXFJkgDyThd0vFwZtBhNnevK4bHlo5ycXBbI8WShS2ks5zzBB JUQnoEq1BGWrjHiTmBeDhtU0D6ViiHzof4M5VDoTSHNPIpd4Uy7+8cvke3QLnj/dKBXL wlAbcnZhCGM+AMp59KP5U3AenRpwNEzxkzSyZGWw/PrYi9XKqJK/PnhdUTPQy/hpMunK S8fA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j73si11530559pge.263.2019.02.26.00.18.26; Tue, 26 Feb 2019 00:18:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727150AbfBZISB (ORCPT + 99 others); Tue, 26 Feb 2019 03:18:01 -0500 Received: from mxhk.zte.com.cn ([63.217.80.70]:29858 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726992AbfBZISA (ORCPT ); Tue, 26 Feb 2019 03:18:00 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id E1C9FE0726FE0D116BE0; Tue, 26 Feb 2019 16:17:58 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x1Q8Hp1Y018889; Tue, 26 Feb 2019 16:17:51 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019022616180546-1860813 ; Tue, 26 Feb 2019 16:18:05 +0800 From: Wen Yang To: lgirdwood@gmail.com Cc: broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, linuxppc-dev@lists.ozlabs.org, wang.yi59@zte.com.cn, Wen Yang Subject: [PATCH 2/3] ASoC: fsl_utils: fix a leaked reference by adding missing of_node_put Date: Tue, 26 Feb 2019 16:17:50 +0800 Message-Id: <1551169071-11639-2-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551169071-11639-1-git-send-email-wen.yang99@zte.com.cn> References: <1551169071-11639-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-02-26 16:18:05, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-02-26 16:17:47, Serialize complete at 2019-02-26 16:17:47 X-MAIL: mse01.zte.com.cn x1Q8Hp1Y018889 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_parse_phandle returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./sound/soc/fsl/fsl_utils.c:74:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 38, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Timur Tabi Cc: Nicolin Chen Cc: Xiubo Li Cc: Fabio Estevam Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org --- sound/soc/fsl/fsl_utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/fsl_utils.c b/sound/soc/fsl/fsl_utils.c index 9981668..040d06b 100644 --- a/sound/soc/fsl/fsl_utils.c +++ b/sound/soc/fsl/fsl_utils.c @@ -71,6 +71,7 @@ int fsl_asoc_get_dma_channel(struct device_node *ssi_np, iprop = of_get_property(dma_np, "cell-index", NULL); if (!iprop) { of_node_put(dma_np); + of_node_put(dma_channel_np); return -EINVAL; } *dma_id = be32_to_cpup(iprop); -- 2.9.5