lkml.org 
[lkml]   [2004]   [Jan]   [3]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSat, 3 Jan 2004 13:42:13 +0100
FromPavel Machek <>
Subjectdo not leak memory in powernow-k8
Hi!

This prevents memory leak if something goes wrong. Please apply,

								Pavel

Index: linux.new/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
===================================================================
--- linux.new.orig/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2003-12-25 13:28:48.000000000 +0100
+++ linux.new/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2003-12-25 13:29:08.000000000 +0100
@@ -687,11 +687,13 @@
 			if (ppst[j].vid < rvo) {	/* vid+rvo >= 0 */
 				printk(KERN_ERR BFX
 				       "0 vid exceeded with pstate %d\n", j);
+				kfree(ppst);
 				return -ENODEV;
 			}
 			if (ppst[j].vid < maxvid+rvo) { /* vid+rvo >= maxvid */
 				printk(KERN_ERR BFX
 				       "maxvid exceeded with pstate %d\n", j);
+				kfree(ppst);
 				return -ENODEV;
 			}
 		}
@@ -706,7 +708,7 @@
 
 		for (j = 0; j < numps; j++)
 			if ((ppst[j].fid==currfid) && (ppst[j].vid==currvid))
-				return (0);
+				return 0;
 
 		printk(KERN_ERR BFX "currfid/vid do not match PST, ignoring\n");
 		return 0;

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:59    [from the cache]
©2003-2008