summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiaolong Ye <yexl@marvell.com>2015-09-11 11:05:23 +0800
committerJiri Slaby <jslaby@suse.cz>2016-01-05 18:38:22 +0100
commite34dac5a89a0b35702690fb28d14e77882c26f8c (patch)
tree95ea2c7d4abc48dd519d165985dab5b0af203356
parent9f102bae333812d94c1ced6add991d5cb6f43e1f (diff)
downloadlwn-e34dac5a89a0b35702690fb28d14e77882c26f8c.tar.gz
lwn-e34dac5a89a0b35702690fb28d14e77882c26f8c.zip
PM / devfreq: Fix incorrect type issue.
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 <yexl@marvell.com> Signed-off-by: Kevin Liu <kliu5@marvell.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Cc: Oliver Neukum <ONeukum@suse.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r--drivers/devfreq/devfreq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index ab1cec5548f0..edccdb0a054a 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -481,7 +481,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;