aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/pm_qos_params.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index a1aea040eb57..f42d3f737a33 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -252,19 +252,21 @@ void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
252 int pending_update = 0; 252 int pending_update = 0;
253 s32 temp; 253 s32 temp;
254 254
255 spin_lock_irqsave(&pm_qos_lock, flags); 255 if (pm_qos_req) { /*guard against callers passing in null */
256 if (new_value == PM_QOS_DEFAULT_VALUE) 256 spin_lock_irqsave(&pm_qos_lock, flags);
257 temp = pm_qos_array[pm_qos_req->pm_qos_class]->default_value; 257 if (new_value == PM_QOS_DEFAULT_VALUE)
258 else 258 temp = pm_qos_array[pm_qos_req->pm_qos_class]->default_value;
259 temp = new_value; 259 else
260 260 temp = new_value;
261 if (temp != pm_qos_req->value) { 261
262 pending_update = 1; 262 if (temp != pm_qos_req->value) {
263 pm_qos_req->value = temp; 263 pending_update = 1;
264 pm_qos_req->value = temp;
265 }
266 spin_unlock_irqrestore(&pm_qos_lock, flags);
267 if (pending_update)
268 update_target(pm_qos_req->pm_qos_class);
264 } 269 }
265 spin_unlock_irqrestore(&pm_qos_lock, flags);
266 if (pending_update)
267 update_target(pm_qos_req->pm_qos_class);
268} 270}
269EXPORT_SYMBOL_GPL(pm_qos_update_request); 271EXPORT_SYMBOL_GPL(pm_qos_update_request);
270 272