Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222509

[PATCH] PM / devfreq: Fix incorrect type issue.

From Xiaolong Ye <yexl@marvell.com>
Newsgroups linux.kernel
Subject [PATCH] PM / devfreq: Fix incorrect type issue.
Date 2015-09-11 05:20 +0200
Message-ID <q7n2x-645-7@gated-at.bofh.it> (permalink)
References <q7mSR-5Su-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 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 ca1b362..ac9845a 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;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] fix incorrect initialization code for trans_stat of devfreq Xiaolong Ye <yexl@marvell.com> - 2015-09-11 05:10 +0200
  [PATCH] PM / devfreq: Fix incorrect type issue. Xiaolong Ye <yexl@marvell.com> - 2015-09-11 05:20 +0200

csiph-web