unbalanced try_get_module/put_module in cpufreq
PATCH 1/1 unbalanced try_get_module/put_module in cpufreq
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
drivers/cpufreq/cpufreq.c +3 -0
@@ -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;
Dave Jones
AppliedQuoted 4 lines · Charles Coffing
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 amodule_put().
Thanks, applied. (Slightly different variant, but same end result).
Dave