https://github.com/torvalds/linux
Revision 53032dafc6b93ac178ca2340ff8eb4ee2b3d1a92 authored by Paul Walmsley on 25 April 2009, 11:28:36 UTC, committed by Liam Girdwood on 28 April 2009, 17:58:07 UTC
During regulator registration, any error after device_register() will
cause a double-free on the struct regulator_dev 'rdev'.  The bug is in
drivers/regulator/core.c:regulator_register():

...
scrub:
	device_unregister(&rdev->dev);
clean:
	kfree(rdev);                           <---
	rdev = ERR_PTR(ret);
	goto out;
...

device_unregister() calls regulator_dev_release() which frees rdev.  The
subsequent kfree corrupts memory and causes some OMAP3 systems to oops on
boot in regulator_get().

Applies against 2.6.30-rc3.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
1 parent cd78dfc
History
Tip revision: 53032dafc6b93ac178ca2340ff8eb4ee2b3d1a92 authored by Paul Walmsley on 25 April 2009, 11:28:36 UTC
regulator core: fix double-free in regulator_register() error path
Tip revision: 53032da
File Mode Size
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
usr
virt
.gitignore -rw-r--r-- 885 bytes
.mailmap -rw-r--r-- 3.9 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 91.6 KB
Kbuild -rw-r--r-- 2.4 KB
MAINTAINERS -rw-r--r-- 144.1 KB
Makefile -rw-r--r-- 53.7 KB
README -rw-r--r-- 16.7 KB
REPORTING-BUGS -rw-r--r-- 3.1 KB

README

back to top