lkml.org 
[lkml]   [2014]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] PM / devfreq: Allocate memory using the right data type
Date
From: Suman Tatiraju <sumant@codeaurora.org>

Long and int have different sizes on a 64-bit machine. Allocate
memory for the time_in_state table using the right data type.

Change-Id: I335277674018c0ea759aa0996309d52578ea1fd5
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
Reviewed-by: Saravana Kannan <skannan@codeaurora.org>
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
---
drivers/devfreq/devfreq.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 65eed38..349e28ea 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -483,9 +483,10 @@ 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->profile->max_state,
- GFP_KERNEL);
+ devfreq->time_in_state = devm_kzalloc(dev,
+ sizeof(*(devfreq->time_in_state)) *
+ devfreq->profile->max_state,
+ GFP_KERNEL);
devfreq->last_stat_updated = jiffies;

dev_set_name(&devfreq->dev, "%s", dev_name(dev));
--
1.8.2.1
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


\
 
 \ /
  Last update: 2014-07-16 05:41    [W:0.119 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site