Bug 12532 - (Patch queued)linux-2.6/arch/arm/mach-omap2/mmc-twl4030.c:400: Memory leak: mmc
Summary: (Patch queued)linux-2.6/arch/arm/mach-omap2/mmc-twl4030.c:400: Memory leak: mmc
Status: RESOLVED CODE_FIX
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: ARM (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Alan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-23 22:33 UTC by Daniel Marjamäki
Modified: 2009-04-08 10:01 UTC (History)
0 users

See Also:
Kernel Version: latest git tree
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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

Note You need to log in before you can comment on or make changes to this bug.