Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4819368ybl; Wed, 22 Jan 2020 05:21:45 -0800 (PST) X-Google-Smtp-Source: APXvYqwG1mLflWqYbpmVH9PxA/55XM+goHDocSpjjdpshPRHxgV8eERfgOjjGMCN85syKhM2jY7G X-Received: by 2002:a05:6830:110a:: with SMTP id w10mr7583318otq.300.1579699305218; Wed, 22 Jan 2020 05:21:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699305; cv=none; d=google.com; s=arc-20160816; b=zQdu+wkWR5I9BBIZi44wBYtfzQ18QpU6/jDO8Ti8w6FLenF/8Yo4uVZ2Vs/nmkZ2Vq 4x+hj+4e0qpug3OUJ/GOBGZKtW+CssVK2Tm+myAuPyE3gX6YhfhucKI00EaU4xbHPdoV T+l/gNmmwyxsov4x2m7W8jYFRvNu6FV/oiOa5A6vkGaiLTexBGmZPR47fh5Zy3zSOrbN i4gVhP/29ycCBMGr1KKgqlrspu869kkmYR0ap7F76n9AS9gzOWA59GuKeGKIIoXpMA2M tLA+71D/OJ33rZ8XsHIhH04QbewTRSzRWxIz6xfJvsN7LIgbxn8RqS1UCB8h15ERaiPa UxrA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XwdpnXfKxqqiLHyipnJ8UL+HTc9NXaCsHuFDMOpEY+A=; b=ugbNfKqVR7qWUTEJju+873RZHqTsI53OGHt9fnurKJiyhc8IivvJqMlIVoTpKDvxLd mWXLY2KpUSFjrgT36CCo0v3mxvminQQQLhjWl02rN4340oaee/s6FvrAn/V+E8CJbKs7 HKGv599ouhAqxUi+xU24LT6j0Vhio8K2E+SBVUNK/ivDb2QMS8JIYC4kGI0BnL23qhml e0fkPS6QCAC2Acxy/DV9i6oxgIgMNbal7KjsvnBniIBgw8fPg+7jes/la23PWoOvfWqr 0jqvUsJReVIPFI+WAgDDxwIRCQnQNUMeiOF4Vl28p23YrIv8oFgKvescWWbKkB6xrixj 5Z2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iOu8h1UM; 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 d17si21013347oib.174.2020.01.22.05.21.33; Wed, 22 Jan 2020 05:21:45 -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=@kernel.org header.s=default header.b=iOu8h1UM; 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 S1728978AbgAVNTa (ORCPT + 99 others); Wed, 22 Jan 2020 08:19:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:35374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729673AbgAVNT2 (ORCPT ); Wed, 22 Jan 2020 08:19:28 -0500 Received: from localhost (unknown [84.241.205.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 627072467E; Wed, 22 Jan 2020 13:19:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699168; bh=EsfXXKZ3mPxHUwIBoC1V7kBeQf4qR+1RmiqD89uuj60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iOu8h1UMBMUXHtOUP8EkFSZZqOOvkX1WT+96c+iJPiu+8MbQXRxyDaiwzclLMUNch kU9hk4cwMC6QzwtOHgZfQjU0V6KuQoirmOlreMoOnxlP8wEV2zLN5Qk5CkqmqIPuxL 1+tACCvLTL+jvl24QLIFVjgjfXGcw9ghY/rtCSuU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ikjoon Jang , "Rafael J. Wysocki" Subject: [PATCH 5.4 034/222] cpuidle: teo: Fix intervals[] array indexing bug Date: Wed, 22 Jan 2020 10:27:00 +0100 Message-Id: <20200122092835.929918908@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ikjoon Jang commit 57388a2ccb6c2f554fee39772886c69b796dde53 upstream. Fix a simple bug in rotating array index. Fixes: b26bf6ab716f ("cpuidle: New timer events oriented governor for tickless systems") Signed-off-by: Ikjoon Jang Cc: 5.1+ # 5.1+ Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/cpuidle/governors/teo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/cpuidle/governors/teo.c +++ b/drivers/cpuidle/governors/teo.c @@ -194,7 +194,7 @@ static void teo_update(struct cpuidle_dr * pattern detection. */ cpu_data->intervals[cpu_data->interval_idx++] = measured_us; - if (cpu_data->interval_idx > INTERVALS) + if (cpu_data->interval_idx >= INTERVALS) cpu_data->interval_idx = 0; }