From: Charles Coffing <ccoffing@novell.com>
To: linux-kernel@vger.kernel.org
Cc: Dominik Brodowski <linux@brodo.de>
Subject: [PATCH] unbalanced try_get_module/put_module in cpufreq
Date: Wed, 21 Apr 2004 10:47:02 -0600 [thread overview]
Message-ID: <200404211047.02906.ccoffing@novell.com> (raw)
Hi,
This patch is against 2.6.5. There's a small bug in cpufreq_add_dev: If kmalloc fails, try_get_module() is not balanced by a module_put().
Thanks,
Charles
diff -pu linux-2.6.5.orig/drivers/cpufreq/cpufreq.c linux-2.6.5/drivers/cpufreq/cpufreq.c
--- linux-2.6.5.orig/drivers/cpufreq/cpufreq.c 2004-04-03 20:36:26.000000000 -0700
+++ linux-2.6.5/drivers/cpufreq/cpufreq.c 2004-04-20 12:38:53.110191544 -0600
@@ -361,7 +361,10 @@ static int cpufreq_add_dev (struct sys_d
policy = kmalloc(sizeof(struct cpufreq_policy), GFP_KERNEL);
if (!policy)
+ {
+ module_put(cpufreq_driver->owner);
return -ENOMEM;
+ }
memset(policy, 0, sizeof(struct cpufreq_policy));
policy->cpu = cpu;
next reply other threads:[~2004-04-21 15:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-21 16:47 Charles Coffing [this message]
2004-04-21 16:05 ` [PATCH] unbalanced try_get_module/put_module in cpufreq Dave Jones
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=200404211047.02906.ccoffing@novell.com \
--to=ccoffing@novell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@brodo.de \
/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