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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,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 4BCABC1B0FD for ; Fri, 18 Jan 2019 21:18:19 +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 1AFF42087E for ; Fri, 18 Jan 2019 21:18:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="intoeHIs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AFF42087E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ispras.ru 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject: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=HToney5EHSWJq3DjsLUB3KR3YC4gqTM/ZyehiBriRro=; b=int oeHIscE2FbKZuFPYlsQiIP20EnPUd+SynGMZeBpVey5MUn6hoDOfXd88B4OOBQ2fr0mQfHI46esmP q3ZNPmd1O5/JBcApGAP83kXoYblQdvUTlYhuEbe9mJmnynZRAhLeCLMA5zU6rCG1arbNoDEf/goht x50JgjChqAVFiCsF2fNdWcegTF3yqCRgmJHfVjUn6JHkgcj7tnqBvnc0OQP9Wi+Z3PYKSkhnYAZen QoMPLkIfWo+276whc/Ujy+9lSvm2RQu6cbxbUL96L9ydqdZrapyEKVlDnbmdhL1niMbvf0b5aP8Ft spq2HgsdK2A2WoRth7vw+MLC8cXh2+Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkbWo-0000fG-Ky; Fri, 18 Jan 2019 21:18:14 +0000 Received: from mail.ispras.ru ([83.149.199.45]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkbWk-0000eB-UK for linux-arm-kernel@lists.infradead.org; Fri, 18 Jan 2019 21:18:12 +0000 Received: from localhost.localdomain (ppp85-140-181-158.pppoe.mtu-net.ru [85.140.181.158]) by mail.ispras.ru (Postfix) with ESMTPSA id 77C56540082; Sat, 19 Jan 2019 00:18:04 +0300 (MSK) From: Alexey Khoroshilov To: Marek Szyprowski , Felipe Balbi Subject: [PATCH] usb: dwc3: exynos: Fix error handling of clk_prepare_enable Date: Sat, 19 Jan 2019 00:17:37 +0300 Message-Id: <1547846257-19970-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190118_131811_157033_7539D66E X-CRM114-Status: GOOD ( 10.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ldv-project@linuxtesting.org, linux-samsung-soc@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Kukjin Kim , Alexey Khoroshilov , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 If clk_prepare_enable() fails in dwc3_exynos_probe(), exynos->clks[0] is left undisabled because of usage preincrement in while condition. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Fixes: 9f2168367a0a ("usb: dwc3: exynos: Rework clock handling and prepare for new variants") --- drivers/usb/dwc3/dwc3-exynos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index cb7fcd7c0ad8..e7f6cff27b9a 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -78,7 +78,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev) for (i = 0; i < exynos->num_clks; i++) { ret = clk_prepare_enable(exynos->clks[i]); if (ret) { - while (--i > 0) + while (i-- > 0) clk_disable_unprepare(exynos->clks[i]); return ret; } -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel