Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp567492ybl; Fri, 10 Jan 2020 03:15:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwqu6IA4KGKGVAbe7oVE6XUHVIa9WyVsLocJr+hPKE4GIOwI4RvaIVdEECppnMwA6ey6Pzy X-Received: by 2002:aca:500f:: with SMTP id e15mr1881655oib.172.1578654909450; Fri, 10 Jan 2020 03:15:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578654909; cv=none; d=google.com; s=arc-20160816; b=x9HnL8YEgJWIp61B/OCiCtt/Pe/8M0wdiJ8lp7oGQNeW1dQLYDMIJOPxQAqFkEiJTg 45LU0ypfG0Va60yqJml81YbyNtTehpP1OCPp2pv4IrloaM+V7jU8JhdgcmuL1LhNE6Ia yGRqUVdZEGYEwDJbcd2WJKTS6d9LEteNs5e89SqvJmX8YdR9UOx5un2BY8xb7BS4ExhZ VbDPvizfLd7psxpYMGShRQvXCUmnkoDFifJG6M1IIEFPlg4G4huBJfTJW6xSqPoRwrV4 G4wzT19t2zfYbSX1CRSYLGjRXoa/efkiTaJf4VWMjtQeQY4z/HQYQqawerwET/3TUb3y A3ZQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=V49jMqEA1Bz5P1lK12dt/96EisXa6+L0fJZzY2hmerY=; b=XTACvUz5qH49Yi//jJzj/Os/YEdPnRyc9i5QDxINpwoVNmozhRLtVlL8xmkpdlAMp2 ZCwKDjJK1Bap80fJYPYQqrrqK6hz6GKH9khWLRS+p2HUf9ZRB0F+s+iGJq1Gk0NP4w71 /VSzYFUOER5V/zVNfJcG8UhyT762eXXVwMm/gcb6+K4D3po2wan2qtMvfMmVDxZeGYqK KlIWB2av9dMDgKmoRVYCS5O+4XOXvjeo0zTqXZ+hBzRu7D611bao0qa/3d+XPt4kfEc+ qvCiHLgqGKhIWtzOz6iPRXj2C5mFifOgh15VNQ0E1Eg+QgufbXyTMMU43MRoMjEwzEKk 5DAQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s20si1050227otq.28.2020.01.10.03.14.58; Fri, 10 Jan 2020 03:15:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727791AbgAJLNb (ORCPT + 99 others); Fri, 10 Jan 2020 06:13:31 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:54139 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727733AbgAJLNb (ORCPT ); Fri, 10 Jan 2020 06:13:31 -0500 Received: from 79.184.255.90.ipv4.supernova.orange.pl (79.184.255.90) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.320) id 72f2d2c43d24f829; Fri, 10 Jan 2020 12:13:29 +0100 From: "Rafael J. Wysocki" To: Ikjoon Jang Cc: linux-pm@vger.kernel.org, "RafaelJ . Wysocki" , DanielLezcano , linux-kernel@vger.kernel.org Subject: Re: [PATCH] BUG-REPORT: cpuidle: teo: intervals[] array index out Date: Fri, 10 Jan 2020 12:13:28 +0100 Message-ID: <2821853.MfSkROXiEm@kreacher> In-Reply-To: <20200110015917.32825-1-ikjn@chromium.org> References: <20200110015917.32825-1-ikjn@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, January 10, 2020 2:59:17 AM CET Ikjoon Jang wrote: > This seems to be a simple bug in rotating array index. That's correct. Please repost the patch with a Signed-off-by tag, so I can apply it. > --- > drivers/cpuidle/governors/teo.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c > index de7e706efd46..6deaaf5f05b5 100644 > --- a/drivers/cpuidle/governors/teo.c > +++ b/drivers/cpuidle/governors/teo.c > @@ -198,7 +198,7 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev) > * pattern detection. > */ > cpu_data->intervals[cpu_data->interval_idx++] = measured_ns; > - if (cpu_data->interval_idx > INTERVALS) > + if (cpu_data->interval_idx >= INTERVALS) > cpu_data->interval_idx = 0; > } > >