From: Xiaolong Ye Date: Fri, 11 Sep 2015 03:05:23 +0000 (+0800) Subject: PM / devfreq: Fix incorrect type issue. X-Git-Tag: firefly_0821_release~176^2~1030^2~1^3^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5f25f066f75a67835abb5e400471a27abd09395b;p=firefly-linux-kernel-4.4.55.git PM / devfreq: Fix incorrect type issue. 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 --- diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 1f3e5ea5439f..3927ed9fdbd5 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -482,7 +482,7 @@ struct devfreq *devfreq_add_device(struct device *dev, 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;