Bug 14236

Summary: found a memory leak in linux-2.6.31/sound/soc/fsl/mpc5200_dma.c
Product: Drivers Reporter: Martin Ettl (ettl.martin)
Component: Sound(OSS)Assignee: drivers_sound
Status: CLOSED CODE_FIX    
Severity: normal CC: alan
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.31 Subsystem:
Regression: No Bisected commit-id:

Description Martin Ettl 2009-09-26 16:54:14 UTC
Hello,

i have checked the linux kernel with the static code analysis tool cppchek. It found a memory leak in file /sound/soc/fsl/mpc5200_dma.c at line 456.

Take a look at the code:
...
	/* Allocate and initialize the driver private data */
	psc_dma = kzalloc(sizeof *psc_dma, GFP_KERNEL);
	if (!psc_dma) {
		iounmap(regs);
		return -ENOMEM;
	}

	/* Get the PSC ID */
	prop = of_get_property(op->node, "cell-index", &size);
	if (!prop || size < sizeof *prop)
456		return -ENODEV;
...

Indeed, there is a missing kfree(psc_dma). 

Best regards

Ettl Martin