Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:45298 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753821AbcKNCF3 (ORCPT ); Sun, 13 Nov 2016 21:05:29 -0500 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Xiaolong Ye" , "MyungJoo Ham" , "Kevin Liu" Date: Mon, 14 Nov 2016 00:14:21 +0000 Message-ID: Subject: [PATCH 3.16 345/346] PM / devfreq: Fix incorrect type issue. In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: 3.16.39-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Xiaolong Ye commit 5f25f066f75a67835abb5e400471a27abd09395b upstream. time_in_state in struct devfreq is defined as unsigned long, so devm_kzalloc should use sizeof(unsigned long) as argument instead of sizeof(unsigned int), otherwise it will cause unexpected result in 64bit system. Signed-off-by: Xiaolong Ye Signed-off-by: Kevin Liu Signed-off-by: MyungJoo Ham Signed-off-by: Ben Hutchings --- drivers/devfreq/devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -483,7 +483,7 @@ struct devfreq *devfreq_add_device(struc devfreq->profile->max_state * devfreq->profile->max_state, GFP_KERNEL); - devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned int) * + devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned long) * devfreq->profile->max_state, GFP_KERNEL); devfreq->last_stat_updated = jiffies;