From patchwork Thu Jun 13 06:58:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10991159 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B6A5924 for ; Thu, 13 Jun 2019 07:00:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6671928B58 for ; Thu, 13 Jun 2019 07:00:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DEE428B81; Thu, 13 Jun 2019 07:00:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 01CEA28B58 for ; Thu, 13 Jun 2019 07:00:09 +0000 (UTC) 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:Subject:To:From:Date:Message-ID: MIME-Version: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=SWM0T8TuPMJXoZXoz0J1L/WmONP2WneMzqwGC+hDE0M=; b=LHPXNRI08htgnH 5eVDcpCga+hyYXjTRA6N0ZvwkOMS2m3htrsb9ee+YZ77b/hO4vk1spQvDaxcpRwF54u8/7yrPkPnQ xHy1xO7UNmlyWZOjgjIfY3bfXnTvaLxWQHMmQkpFa9iUbetOXhJXxOqgOvfoseZL6d8OUeyXSrZpJ qWBqx/7H4zv3ORkFuUKcczJx5iBDHAmzaRgcFkpEaV1NJY3MbZK+hs8mJPCWsOs+yfmQX+jppci+X k3IZH5ZWvJvvLzOexBe39uHujPwGFdAC4kidLajO4rhUjZxjVbwyfYLzESpQXC8EkUxqwIun6N/sk xBR63ivcYLwbGwWFNPkQ==; 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 1hbJiK-0007BB-N4; Thu, 13 Jun 2019 07:00:00 +0000 Received: from aserp2130.oracle.com ([141.146.126.79]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hbJiH-0006UK-RV for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2019 06:59:59 +0000 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5D6xBJ1034408; Thu, 13 Jun 2019 06:59:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : to : cc : subject : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=hAsqs/UCvL0W8EmDOxiao4xeBzroLyAyKeIw+Px3dyU=; b=G6JCEkgrcQ+/dugNXKTSOwlOR1LC8mThLjNBJ0TneBYu8TfH6QXfVxGSem/fcXAnhNtX gkcVfN0Z1LrIYC5kwB9rkYnjAT5j0sfggmGeibiQ0KKcNenVVX2JxC5NKMbfmbgW3rsz +4TIXyWaO1A1MCjCTUa9kfz2WZNEdUccecK5RWOtTSxqKyAyaB64f9ookcJM4Wh4jUja pJL13Msbj/tpTtOX7DndbhDF5oU0IVS4y59lD7ga96+/3SokDGViOxrmiLxuknQp/kWJ iI/EXhaV1PmH3hQAXqPQM/p50mLcK3A38+XcN65m6Avk9RLj8qNWrQ+LDdms/NB5f6XK UQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2130.oracle.com with ESMTP id 2t02heysbs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2019 06:59:40 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5D6xI24156856; Thu, 13 Jun 2019 06:59:40 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2t04j0a375-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2019 06:59:40 +0000 Received: from abhmp0022.oracle.com (abhmp0022.oracle.com [141.146.116.28]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x5D6xdHB014323; Thu, 13 Jun 2019 06:59:39 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 12 Jun 2019 23:58:23 -0700 USER-AGENT: Mutt/1.10.1 (2018-07-13) MIME-Version: 1.0 Message-ID: <20190613065815.GF16334@mwanda> Date: Wed, 12 Jun 2019 23:58:15 -0700 (PDT) From: Dan Carpenter To: Mathieu Poirier , Leo Yan Subject: [PATCH] coresight: potential uninitialized variable in probe() X-Mailer: git-send-email haha only kidding X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9286 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906130056 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9286 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906130056 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190612_235957_991240_74042FDC X-CRM114-Status: GOOD ( 13.92 ) 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: Alexander Shishkin , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Suzuki K Poulose Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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. 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))