From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: linux-pm@lists.linux-foundation.org
Cc: James.Bottomley@suse.de, mark.gross@intel.com
Subject: [PATCH] kzalloc params swapped in pm_qos_power_open
Date: Sun, 22 Aug 2010 15:35:44 +0100 [thread overview]
Message-ID: <20100822143544.GC23310@gallifrey> (raw)
Hi,
I was playing with sparse and it looks like it spotted that
the kzalloc in pm_qos_power_open in the current Linus's git tree
seems to have its parameters swapped. I've got a patch below,
I've only build tested it.
Signed-off-by: David Alan Gilbert <linux@treblig.org>
---
**BUILD TESTED ONLY** (against current git)
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index 996a4de..71dcc21 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -348,7 +348,7 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp)
pm_qos_class = find_pm_qos_object_by_minor(iminor(inode));
if (pm_qos_class >= 0) {
- struct pm_qos_request_list *req = kzalloc(GFP_KERNEL, sizeof(*req));
+ struct pm_qos_request_list *req = kzalloc(sizeof(*req), GFP_KERNEL);
if (!req)
return -ENOMEM;
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ gro.gilbert @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
next reply other threads:[~2010-08-22 14:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-22 14:35 Dr. David Alan Gilbert [this message]
2010-08-22 23:34 ` [PATCH] kzalloc params swapped in pm_qos_power_open Gross, Mark
2010-08-24 20:19 ` Rafael J. Wysocki
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=20100822143544.GC23310@gallifrey \
--to=linux@treblig.org \
--cc=James.Bottomley@suse.de \
--cc=linux-pm@lists.linux-foundation.org \
--cc=mark.gross@intel.com \
/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