Bug 14236 - found a memory leak in linux-2.6.31/sound/soc/fsl/mpc5200_dma.c
Summary: found a memory leak in linux-2.6.31/sound/soc/fsl/mpc5200_dma.c
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(OSS) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_sound
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-26 16:54 UTC by Martin Ettl
Modified: 2012-06-13 17:11 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.31
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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

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