diff options
author | Xiaolong Ye <yexl@marvell.com> | 2015-09-11 11:05:23 +0800 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2016-11-20 01:17:39 +0000 |
commit | 3465266e970e0506c7ce7b582db5e433ad8912fa (patch) | |
tree | 2829ce3757073bf892a8ee1a940a52fdfe52aeda | |
parent | a040696e6686ac65be13ee5a72c945e63c48be70 (diff) | |
download | lwn-3465266e970e0506c7ce7b582db5e433ad8912fa.tar.gz lwn-3465266e970e0506c7ce7b582db5e433ad8912fa.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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | drivers/devfreq/devfreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 9f90369dd6bd..ba850eb2d275 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -483,7 +483,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; |