From patchwork Tue Oct 7 16:19:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 5047161 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 808B99F295 for ; Tue, 7 Oct 2014 16:21:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0EF820220 for ; Tue, 7 Oct 2014 16:21:15 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A553C20148 for ; Tue, 7 Oct 2014 16:21:14 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id ACCDE260623; Tue, 7 Oct 2014 18:21:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 8478626056D; Tue, 7 Oct 2014 18:20:28 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5F0B72605CB; Tue, 7 Oct 2014 18:20:27 +0200 (CEST) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id A154626057F for ; Tue, 7 Oct 2014 18:20:14 +0200 (CEST) Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4A119AAF1; Tue, 7 Oct 2014 16:20:14 +0000 (UTC) From: Takashi Iwai To: Mark Brown Date: Tue, 7 Oct 2014 18:19:51 +0200 Message-Id: <1412698794-25536-2-git-send-email-tiwai@suse.de> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1412698794-25536-1-git-send-email-tiwai@suse.de> References: <1412698794-25536-1-git-send-email-tiwai@suse.de> Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 1/4] ASoC: mc13783: Fix of_node_put() call with uninitialized object X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The commit [a28d167fbbef: ASoC: mc13783: Add missing of_node_put] fixed the leak of OF node, but it calls of_node_put() unconditionally at error path where the passed pointer might be uninitialized. It was caught by a compiler warning: sound/soc/codecs/mc13783.c:787:13: warning: 'np' may be used uninitialized in this function [-Wuninitialized] This patch adds the NULL initialization properly for fixing this. Fixes: a28d167fbbef ('ASoC: mc13783: Add missing of_node_put') Signed-off-by: Takashi Iwai --- sound/soc/codecs/mc13783.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c index 388f90a597fa..f54fdf6fc20d 100644 --- a/sound/soc/codecs/mc13783.c +++ b/sound/soc/codecs/mc13783.c @@ -749,7 +749,7 @@ static int __init mc13783_codec_probe(struct platform_device *pdev) { struct mc13783_priv *priv; struct mc13xxx_codec_platform_data *pdata = pdev->dev.platform_data; - struct device_node *np; + struct device_node *np = NULL; int ret; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);