[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1486322486-8024-1-git-send-email-w@1wt.eu>
Date: Sun, 5 Feb 2017 20:20:17 +0100
From: Willy Tarreau <w@....eu>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
linux@...ck-us.net
Cc: Xiaolong Ye <yexl@...vell.com>, Kevin Liu <kliu5@...vell.com>,
MyungJoo Ham <myungjoo.ham@...sung.com>,
Willy Tarreau <w@....eu>
Subject: [PATCH 3.10 030/319] PM / devfreq: Fix incorrect type issue.
From: Xiaolong Ye <yexl@...vell.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@...vell.com>
Signed-off-by: Kevin Liu <kliu5@...vell.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@...sung.com>
Signed-off-by: Willy Tarreau <w@....eu>
---
drivers/devfreq/devfreq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 3b36797..d5cbb7c 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -472,7 +472,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;
--
2.8.0.rc2.1.gbe9624a
Powered by blists - more mailing lists