From: kpark3469@gmail.com
To: linux-pm@vger.kernel.org
Cc: keun-o.park@windriver.com, len.brown@intel.com, rjw@sisk.pl
Subject: [PATCH] PM / QOS: correct the valid range of pm_qos_class
Date: Wed, 12 Jun 2013 14:53:15 +0900 [thread overview]
Message-ID: <1371016395-20688-1-git-send-email-kpark3469@gmail.com> (raw)
From: Sahara <keun-o.park@windriver.com>
The valid start index for pm_qos_array is not 0 but 1. There is a
null_pm_qos at index 0 of pm_qos_array. However, null_pm_qos is not
created as misc device so that inclusion of 0 index for checking
pm_qos_class especially for file operations is not proper here.
Signed-off-by: Sahara <keun-o.park@windriver.com>
---
kernel/power/qos.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/power/qos.c b/kernel/power/qos.c
index 587ddde..ec6f0a7 100644
--- a/kernel/power/qos.c
+++ b/kernel/power/qos.c
@@ -477,7 +477,7 @@ static int find_pm_qos_object_by_minor(int minor)
{
int pm_qos_class;
- for (pm_qos_class = 0;
+ for (pm_qos_class = 1;
pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) {
if (minor ==
pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor)
@@ -491,7 +491,7 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp)
long pm_qos_class;
pm_qos_class = find_pm_qos_object_by_minor(iminor(inode));
- if (pm_qos_class >= 0) {
+ if (pm_qos_class >= 1) {
struct pm_qos_request *req = kzalloc(sizeof(*req), GFP_KERNEL);
if (!req)
return -ENOMEM;
--
1.7.1
next reply other threads:[~2013-06-12 5:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-12 5:53 kpark3469 [this message]
2013-06-12 11:16 ` [PATCH] PM / QOS: correct the valid range of pm_qos_class Rafael J. Wysocki
2013-06-13 2:31 kpark3469
2013-07-09 13:29 ` mark gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371016395-20688-1-git-send-email-kpark3469@gmail.com \
--to=kpark3469@gmail.com \
--cc=keun-o.park@windriver.com \
--cc=len.brown@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).