From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT 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 B74B5C31E45 for ; Thu, 13 Jun 2019 07:49:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8AAF420851 for ; Thu, 13 Jun 2019 07:49:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rCi1l4Wy"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="q3wHpbh5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8AAF420851 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1wi8M6eWhaU2i0dIUlOWTu47w7R177P+ZzqDKhRWXvY=; b=rCi1l4WyNywijb KWu5X42dLZnsvmmc0fohFWE0Y/oeCzetGg6dxuG+vyZd+xjR3Ggl+zsZTc4r/Y7CPFKfEiQw8GZRl 5Z0bqpOQ65jXgafj38TiLAWdMdgXGNF7ueH+Cy6dcMqFDJM1GYheIpKtFCF4jDNjd8uCqphUMBsWM LBVaFIGWO+NCFIe2TATB22TH8EDfnElt51VVweUflx/aYHWLJSA23V3EPaFpoQiiN/ylxHWXqiHzI 9CutenT1IJAMqjGRu8ZhTgG9IEIKimDbV2ehMz1hUOEVC5QrOPtSQvpYHb3634HKcqqewZV7jl9Z9 MImX1BXo0KdYnbu32GqA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbKUN-0001rR-AL; Thu, 13 Jun 2019 07:49:39 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hbKUK-0001qW-Vw for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2019 07:49:38 +0000 Received: by mail-qt1-x842.google.com with SMTP id i34so21463659qta.6 for ; Thu, 13 Jun 2019 00:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xROEx50vg3PrTIRbBL87vn9xq3zmqd182DXiss4gqbM=; b=q3wHpbh5ZcLjlQW7kj7YYZuO2MWWre3rKFc1xRiJRLPzhfF+0X6mVWIIMfzvS7Rsiu qlPzgPoi0qh7StRWKqeJwocEpa4r/p/0lRP7wTbxbWhwGRycC1XHHnsa7tARYuIaHZnm j4fLn76lVPiHH7mJirtdmCF6+fHru+SnN8zCtaQN7+7PoewJmPVd16kR6ZrQZ/OpXdP8 klOVVdV4cUYSIuz7trkXErJMZt7wxUdrHLY+SR+Rc+VfJ21s3amIh7TVMbdmHYZLN7gZ hdO61fuW89DO1MElkjaiiN2Xw4u7bb1mVsfdNf85byeAIDhSG0GKhEeZ38Xl8sFqqo2p a21A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xROEx50vg3PrTIRbBL87vn9xq3zmqd182DXiss4gqbM=; b=WJzMDTR5yBFMj2lmenSebcYFj0Ucpe8hFxcy1APnyKfRWaGemPiUO/fvx87Lkd2TrW f5XFC0QP2FmVdv/gnCV8Lz0PKzn9Voty2dEr7m1+JxnNeAP7aH8Ey1L//x0Ia0n2hznI Py2r0jnS2OHSh8FQdqUGF15K/jUECbQiMSAN5GMvcYkOKqSMGUI/ZBVgn3RhIgOBp0jy wqxjzB6JeS64+PfO7Gqrb21be7dXW146dP0AR683KPR4A8dhASrvdCVIcreugwG1siRK f7jQFKqN1isJjEwDM6e8yWw2ScUdRky70edQedjPljJyKVGQgd9dPgMiy1SLbg2IHU2l 6l2g== X-Gm-Message-State: APjAAAWLwfuEEtSJMEzKwwEA1BQLUt92MVeMWcrLzA4BBY+OznxTIKM2 GofFezIGwC5m3QdMWjhSxujMTA== X-Google-Smtp-Source: APXvYqwEurFoZHKAEhOSIDN36DqZuW8gdc1FPaANBB2DIiStrJOy1JF8fsQVRp2blw4EqjOl1eZlsQ== X-Received: by 2002:ac8:3668:: with SMTP id n37mr29172383qtb.236.1560412174396; Thu, 13 Jun 2019 00:49:34 -0700 (PDT) Received: from leoy-ThinkPad-X240s (li1322-146.members.linode.com. [45.79.223.146]) by smtp.gmail.com with ESMTPSA id s44sm1537967qtc.8.2019.06.13.00.49.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2019 00:49:33 -0700 (PDT) Date: Thu, 13 Jun 2019 15:49:22 +0800 From: Leo Yan To: Dan Carpenter Subject: Re: [PATCH] coresight: potential uninitialized variable in probe() Message-ID: <20190613074922.GB21113@leoy-ThinkPad-X240s> References: <20190613065815.GF16334@mwanda> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190613065815.GF16334@mwanda> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190613_004937_093592_A618572C X-CRM114-Status: GOOD ( 17.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Dan, On Wed, Jun 12, 2019 at 11:58:15PM -0700, Dan Carpenter wrote: > The "drvdata->atclk" clock is optional, but if it gets set to an error > pointer then we're accidentally return an uninitialized variable instead > of success. You are right, thanks a lot for pointing out. I'd like to initialize 'ret = 0' at the head of function, so we can has the same fashion with other CoreSight drivers (e.g. replicator). static int funnel_probe(struct device *dev, struct resource *res) { - int ret; + int ret = 0; If you agree, could you send a new patch for this? Thanks, Leo Yan > Fixes: 78e6427b4e7b ("coresight: funnel: Support static funnel") > Signed-off-by: Dan Carpenter > --- > drivers/hwtracing/coresight/coresight-funnel.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c > index 5867fcb4503b..fa97cb9ab4f9 100644 > --- a/drivers/hwtracing/coresight/coresight-funnel.c > +++ b/drivers/hwtracing/coresight/coresight-funnel.c > @@ -244,6 +244,7 @@ static int funnel_probe(struct device *dev, struct resource *res) > } > > pm_runtime_put(dev); > + ret = 0; > > out_disable_clk: > if (ret && !IS_ERR_OR_NULL(drvdata->atclk)) > -- > 2.20.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel