Bug 12532

Summary: (Patch queued)linux-2.6/arch/arm/mach-omap2/mmc-twl4030.c:400: Memory leak: mmc
Product: Platform Specific/Hardware Reporter: Daniel Marjamäki (danielm77)
Component: ARMAssignee: Alan (alan)
Status: RESOLVED CODE_FIX    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: latest git tree Subsystem:
Regression: No Bisected commit-id:

Description Daniel Marjamäki 2009-01-23 22:33:07 UTC
In the function twl4030_mmc_init the mmc is allocated in a loop.

In the loop there is a switch where the default case looks like this:

		default:
			pr_err("MMC%d configuration not supported!\n", c->mmc);
			continue;

When that path is used the mmc will leak memory. I suggest adding a kfree there.

This leak was found by cppcheck - http://sourceforge.net/projects/cppcheck
Comment 1 Alan 2009-03-20 06:13:18 UTC
Thanks .. queued a fix