Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1573554ybv; Thu, 6 Feb 2020 06:19:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzbunau3D6JXdSHlnBKKf1nhnV1VflrUxgFqTqevu8IvcSrGeCYTN1gfmQlnze+VGzwvnAy X-Received: by 2002:a05:6830:10c6:: with SMTP id z6mr31824268oto.203.1580998788545; Thu, 06 Feb 2020 06:19:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580998788; cv=none; d=google.com; s=arc-20160816; b=aKKHjOT59yr7XhzQUbBYCSmnPPAVarfDDzB6vSRWJzoL2HSD7I6IACjWsNIIO2owkq LOgQ8DJXp8rzgl0OBB4R3tkEBBMU7uCxnwLYIbnj7nW5EN76eGo5AOCsSDGZyN+3TVIn IeBuCwc25fFdTW03AxrXRLyTe1/FUZBCLZtw/Q4QnZP7ACeYooknlBEs6BaWLmCZ6jJo dzRILc7Bfx2A9Uy7ll6vz3+swHJYpWVIRAd+MVJovopz3qK1Wr7Qy0ucwN1EUjz4vHLC TaOw+EZAQCpYR93/8z2DcU6YkCXeESiH4v+i1npNwl3CKX4xxj2A/bHcUTzT1n2/Va9y CasQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tlgS5FHChO1CGBWXTjxXUP4mkvuvW/nEiNannwwjUKs=; b=RQ2dUDl7TyCLq/ejIJtwFE26WvTIhZvWk31Svy/SJLIH2LNu2rGUrq6KTqZHuV/3Xu oUqbeZvVxnX0FNfiiu+KnEYmRdvhPknKoviyGpHPoTCJKlUewEf7SkYQivqhVbX2Wj39 +gFwxcAWkwGDIDN1WT+54N6NluS9EtuN+t1HQ5Kfjwa4XA71UQ6QYdxA/1tFFhshV9Dr fDYXeprbD1S5M7+/yAjaKJXZ+fchAXWiFVOtxZ8oW6jhuUGPdhlVqxK0iBHLyjWZY4De ZmLcC3qjDCxpwKa/L50IL0I3L0WQfarTaSTBkJQ+cwXVURzAz9lRBJcDq9T1LUxFXdkt /H9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C5fKtB+H; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o15si1923217otp.314.2020.02.06.06.19.27; Thu, 06 Feb 2020 06:19:48 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C5fKtB+H; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728019AbgBFOSU (ORCPT + 99 others); Thu, 6 Feb 2020 09:18:20 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43543 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726765AbgBFOSU (ORCPT ); Thu, 6 Feb 2020 09:18:20 -0500 Received: by mail-pf1-f196.google.com with SMTP id s1so3187915pfh.10; Thu, 06 Feb 2020 06:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tlgS5FHChO1CGBWXTjxXUP4mkvuvW/nEiNannwwjUKs=; b=C5fKtB+HfWa9s3R1yA90NR/reVyYx5PpUorZVhZhyxP8LEYRU34BddbXV657OB3yVg aUlRzqD2KzLwXLEVCEV2isyrS6k/qilnKMlKF28I33QP/ZjF0OEvvCk6DNqGepF+tWEC fAVLPs8p1E4iOwgJD29JREWzS7yUUWMev+5XSy3cKElgs81rAePv5maOhZqzv8J+yem8 6Cr5+xsL9gaZyla9r3zRhJ3V4E3ZvQ8Jq9BBWf6hZUFj6OOPyqcQv8v2ejVF22yVJ5xj 2qBYjtCInRJIomYHfGtwJKsXnoe/h40K9OfLC7SYR4/SjgjzEjPIMrwVK7cDLZPU/ymu oZbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tlgS5FHChO1CGBWXTjxXUP4mkvuvW/nEiNannwwjUKs=; b=JdnCVgvnwjKQHMEvaq7SpWnX3mrzSJEkYkzFsUVouAcktJprvj684PzIuolshVouHm EjXYe0nOZdFq1Mg+aFCCMmd2FxDITaHni9hy22LIxS67AGsZ+5IiiMGXJJP04/5XoUC5 OlhFV1xhnvsq5vXMs6SouYaBHiGBLMykTwJlRc9qbKzci/onLJ0kBmYjEvb5WTiEryQh 49YqRP9MJeGLz3QdiP2p0+hQyIYuf5GJ4ane0mMuFVTzuViHOXnSqLXEhWpw+WdAMLBw XAK1NoV2cqxMBNRdQxqv/9NlCBxefi0CU8KJXQ3uNcLOg0IcD8CvUTX8GYpcnulDXjPg /CYQ== X-Gm-Message-State: APjAAAV2ZOqFSQXcdL4pf0dpDlbISo5EihgEF9sPyzJZE4JKsEqIdUGU xkfdw08wbEVUAqb8RPpk2z0= X-Received: by 2002:a63:e007:: with SMTP id e7mr3793478pgh.414.1580998699750; Thu, 06 Feb 2020 06:18:19 -0800 (PST) Received: from localhost (104.128.80.227.16clouds.com. [104.128.80.227]) by smtp.gmail.com with ESMTPSA id i9sm3656678pfk.24.2020.02.06.06.18.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Feb 2020 06:18:19 -0800 (PST) From: Dejin Zheng To: vkoul@kernel.org, peppe.cavallaro@st.com, joabreu@synopsys.com, davem@davemloft.net, mcoquelin.stm32@gmail.com, niklas.cassel@linaro.org, netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dejin Zheng Subject: [PATCH v2] net: stmmac: fix a possible endless loop Date: Thu, 6 Feb 2020 22:18:11 +0800 Message-Id: <20200206141811.24862-1-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It forgot to reduce the value of the variable retry in a while loop in the ethqos_configure() function. It may cause an endless loop and without timeout. Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos") Signed-off-by: Dejin Zheng Acked-by: Vinod Koul --- Vinod Koul and David Miller, Thanks for your comments! V2: add an appropriate Fixes tag. drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 7ec895407d23..e0a5fe83d8e0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -413,6 +413,7 @@ static int ethqos_configure(struct qcom_ethqos *ethqos) dll_lock = rgmii_readl(ethqos, SDC4_STATUS); if (dll_lock & SDC4_STATUS_DLL_LOCK) break; + retry--; } while (retry > 0); if (!retry) dev_err(ðqos->pdev->dev, -- 2.25.0