Messages in this thread Patch in this message | | | From | Ben Hutchings <> | Date | Mon, 14 Nov 2016 00:14:21 +0000 | Subject | [PATCH 3.16 345/346] PM / devfreq: Fix incorrect type issue. |
| |
3.16.39-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Xiaolong Ye <yexl@marvell.com>
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> --- 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;
| |